|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pfsw.text.StringScanner
org.pfsw.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.pfsw.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 | |
|---|---|
void |
appendUpToPosition(java.lang.StringBuffer strBuffer,
int pos)
Appends all characters from the current position up to the specified position of the examined string to the given buffer. |
protected void |
appendUpToPosition(java.lang.StringBuffer strBuffer,
int pos,
boolean peek)
Returns the a string containing all characters from the current position up to the specified position of the examined string. |
protected boolean |
charsAreEqual(char char1,
char char2)
|
int |
findPositionOf(java.lang.String matchString)
Returns the position index of the given match string starting to look for it from the current position. |
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. |
java.lang.String |
peekUpToPosition(int pos)
Returns the a string containing all characters from the current position up to the specified position 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. |
java.lang.String |
upToPosition(int pos)
Returns the a string containing all characters from the current position up to the specified position of the examined string. |
| Methods inherited from class org.pfsw.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 examined
public StringExaminer(java.lang.String stringToExamine,
boolean ignoreCase)
stringToExamine - The string that should be examinedignoreCase - Specified whether or not treating the string case insensitive| Method Detail |
|---|
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 int findPositionOf(java.lang.String matchString)
public 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()
public java.lang.String peekUpToPosition(int pos)
public java.lang.String upToPosition(int pos)
public void appendUpToPosition(java.lang.StringBuffer strBuffer,
int pos)
protected boolean charsAreEqual(char char1,
char char2)
protected java.lang.String upToEnd(boolean peek)
protected void appendUpToPosition(java.lang.StringBuffer strBuffer,
int pos,
boolean peek)
protected boolean ignoreCase()
protected void ignoreCase(boolean newValue)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||