public class StringExaminer extends StringScanner
buffer, END_REACHED, length, pos_marker, position
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
atEnd, endNotReached, endReached, getPosition, hasNext, length, markPosition, nextChar, nextNoneWhitespaceChar, peek, restorePosition, setPosition, skip, toString
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
insensitiveprotected boolean ignoreCase()
protected void ignoreCase(boolean newValue)
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)
char1
- char2
- protected java.lang.String upToEnd(boolean peek)
peek
- Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.