| java.lang.Object org.jargp.CharTracker
CharTracker | public class CharTracker (Code) | | Character tracker for processing text. This is effectively a specialized
iterator for processing characters in a string one at a time.
author: Dennis M. Sosnoski version: 1.0 |
Method Summary | |
public boolean | hasNext() Check if another character is available. | public char | next() Get next character from string, advancing past that character. | public char | peek() Peek next character from string. |
CharTracker | public CharTracker(String source, int offset)(Code) | | Constructor
Parameters: source - string supplying character data Parameters: offset - initial character position within source string |
hasNext | public boolean hasNext()(Code) | | Check if another character is available.
true if a character is available, false if at end |
next | public char next()(Code) | | Get next character from string, advancing past that character.
next character from string exception: ArrayIndexOutOfBoundsException - if past end of text |
peek | public char peek()(Code) | | Peek next character from string. Gets the next character without
advancing the current character position.
next character from string exception: ArrayIndexOutOfBoundsException - if past end of text |
|
|