Package overit.geocall.util
Class StringProcessor
java.lang.Object
overit.geocall.util.StringProcessor
- All Implemented Interfaces:
Iterator
Utility class used to create a PoweredString that implements
Iterator-
Constructor Summary
ConstructorsConstructorDescriptionCreates new PoweredStringStringProcessor(String s, boolean bIgnoreCase) Creates new PoweredString -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasNext()intReturns the index within this string of the first occurrence of the specified substring.intReturns the index within this string of the first occurrence of the specified substring, starting at the specified index.iterator()Returns the iteratornext()voidremove()replace(char c1, char c2) Replace the first parameter with the second oneReplace the first parameter with the second oneString[]The string tokenize allows an application to break a string into tokens.String[]The string tokenize allows an application to break a string into tokens.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
StringProcessor
Creates new PoweredString- Parameters:
s- String representing the StringProcessor
-
StringProcessor
Creates new PoweredString- Parameters:
s- String representing the StringProcessorbIgnoreCase- Boolean value that indicates if ignore case is active
-
-
Method Details
-
toString
-
replace
Replace the first parameter with the second one- Parameters:
c1- The char to be replacedc2- The replacing char- Returns:
- The string with the replaced char
-
replace
Replace the first parameter with the second one- Parameters:
s1- The string to be replaceds2- The replacing string- Returns:
- The string wiht the replaced string
-
indexOf
Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. The returned index is the smallest value k for which: k >= fromIndex && this.startsWith(str, k) If no such value of k exists, then -1 is returned.- Parameters:
s- The substring to search fori- The index from wich to start the search- Returns:
- The index of the first occurrence of the specified string, starting at the specified index, -1 if there is no such occurrence
-
indexOf
Returns the index within this string of the first occurrence of the specified substring. The returned index is the smallest value k for which: k <= fromIndex && this.startsWith(str, k) If no such value of k exists, then -1 is returned.- Parameters:
s- The substring to search for- Returns:
- The index of the first occurrence of the specified string, -1 if there is no such occurrence
-
tokenize
The string tokenize allows an application to break a string into tokens.- Parameters:
d- The delimiter string (the string that separate tokens)- Returns:
- An array of tokenized string
-
tokenize
The string tokenize allows an application to break a string into tokens.- Parameters:
d- The delimiter string (the string that separate tokens)max- Maximun number of time it should be tokenized, '0' to tokenize till the end- Returns:
- An array of tokenized string
-
iterator
Returns the iterator- Returns:
- The iterator
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()
-