|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.pf.text.StringScanner org.pf.text.StringExaminer
public class StringExaminer
As a subclass of StringScanner this class allows more advanced navigation
over the underlying string.
That includes moving to positions of specific substrings etc.
Field Summary |
---|
Fields inherited from class org.pf.text.StringScanner |
---|
buffer, END_REACHED, length, pos_marker, position |
Constructor Summary | |
---|---|
StringExaminer(String stringToExamine)
Initialize the new instance with the string to examine. |
|
StringExaminer(String stringToExamine,
boolean ignoreCase)
Initialize the new instance with the string to examine. |
Method Summary | |
---|---|
protected boolean |
charsAreEqual(char char1,
char char2)
|
protected boolean |
ignoreCase()
|
protected void |
ignoreCase(boolean newValue)
|
String |
peekUpToEnd()
Returns the a string containing all characters from the current position up to the end of the examined string. |
boolean |
skipAfter(String matchString)
Increments the position pointer up to the last character that matched the character sequence in the given matchString. |
boolean |
skipBefore(String matchString)
Increments the position pointer up to the first character before the character sequence in the given matchString. |
String |
upToEnd()
Returns the a string containing all characters from the current position up to the end of the examined string. |
protected String |
upToEnd(boolean peek)
Returns the a string containing all characters from the current position up to the end of the examined string. |
Methods inherited from class org.pf.text.StringScanner |
---|
atEnd, endNotReached, endReached, getPosition, hasNext, length, markPosition, nextChar, nextNoneWhitespaceChar, peek, restorePosition, setPosition, skip, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StringExaminer(String stringToExamine)
stringToExamine
- The string that should be examinedpublic StringExaminer(String stringToExamine, boolean ignoreCase)
stringToExamine
- The string that should be examinedignoreCase
- Specified whether or not treating the string case insensitiveMethod Detail |
---|
protected boolean ignoreCase()
protected void ignoreCase(boolean newValue)
public boolean skipAfter(String matchString)
If the matchString was found, the next invocation of method nextChar() returns the first character after that matchString.
matchString
- The string to look uppublic boolean skipBefore(String matchString)
If the matchString was found, the next invocation of method nextChar() returns the first character of that matchString from the position where it was found inside the examined string.
matchString
- The string to look uppublic String peekUpToEnd()
public String upToEnd()
protected boolean charsAreEqual(char char1, char char2)
protected String upToEnd(boolean peek)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |