| |
|
| java.lang.Object com.sshtools.daemon.util.StringScanner com.sshtools.daemon.util.StringExaminer
StringExaminer | public class StringExaminer extends StringScanner (Code) | | As a subclass of StringScanner this class allows more advanced navigation
over the underlying string.
That includes moving to positions of specific substrings etc.
author: Manfred Duchrow version: $Id: StringExaminer.java,v 1.7 2003/09/11 15:37:07 martianx Exp $ |
Constructor Summary | |
public | StringExaminer(String stringToExamine) Initialize the new instance with the string to examine. | public | 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) | public String | peekUpToEnd() Returns the a string containing all characters from the current position
up to the end of the examined string. | public boolean | skipAfter(String matchString) Increments the position pointer up to the last character that matched
the character sequence in the given matchString. | public boolean | skipBefore(String matchString) Increments the position pointer up to the first character before the
character sequence in the given matchString. | public 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. |
StringExaminer | public StringExaminer(String stringToExamine)(Code) | | Initialize the new instance with the string to examine.
The string will be treated case-sensitive.
Parameters: stringToExamine - The string that should be examined |
StringExaminer | public StringExaminer(String stringToExamine, boolean ignoreCase)(Code) | | Initialize the new instance with the string to examine.
Parameters: stringToExamine - The string that should be examined Parameters: ignoreCase - Specified whether or not treating the string caseinsensitive |
charsAreEqual | protected boolean charsAreEqual(char char1, char char2)(Code) | | Parameters: char1 - Parameters: char2 - |
ignoreCase | protected boolean ignoreCase()(Code) | | |
ignoreCase | protected void ignoreCase(boolean newValue)(Code) | | Parameters: newValue - |
peekUpToEnd | public String peekUpToEnd()(Code) | | Returns the a string containing all characters from the current position
up to the end of the examined string.
The character position of the examiner is not changed by this method.
|
skipAfter | public boolean skipAfter(String matchString)(Code) | | Increments the position pointer up to the last character that matched
the character sequence in the given matchString. Returns true, if the
matchString was found, otherwise false.
If the matchString was found, the next invocation of method nextChar()
returns the first character after that matchString.
Parameters: matchString - The string to look up |
skipBefore | public boolean skipBefore(String matchString)(Code) | | Increments the position pointer up to the first character before the
character sequence in the given matchString. Returns true, if the
matchString was found, otherwise false.
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.
Parameters: matchString - The string to look up |
upToEnd | public String upToEnd()(Code) | | Returns the a string containing all characters from the current position
up to the end of the examined string.
The character position is put to the end by this method. That means the
next invocation of nextChar() returns END_REACHED.
|
upToEnd | protected String upToEnd(boolean peek)(Code) | | Returns the a string containing all characters from the current position
up to the end of the examined string.
Depending on the peek flag the character position of the examiner is
unchanged (true) after calling this method or points behind the strings
last character.
Parameters: peek - |
|
|
|