|
|||||||||
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(java.lang.String stringToExamine)
Initialize the new instance with the string to examine. |
|
StringExaminer(java.lang.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)
|
java.lang.String |
peekUpToEnd()
Returns the a string containing all characters from the current position up to the end of the examined string. |
boolean |
skipAfter(java.lang.String matchString)
Increments the position pointer up to the last character that matched the character sequence in the given matchString. |
boolean |
skipBefore(java.lang.String matchString)
Increments the position pointer up to the first character before the character sequence in the given matchString. |
java.lang.String |
upToEnd()
Returns the a string containing all characters from the current position up to the end of the examined string. |
protected java.lang.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(java.lang.String stringToExamine)
stringToExamine
- The string that should be examinedpublic StringExaminer(java.lang.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(java.lang.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(java.lang.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 java.lang.String peekUpToEnd()
public java.lang.String upToEnd()
protected boolean charsAreEqual(char char1, char char2)
protected java.lang.String upToEnd(boolean peek)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |