| java.lang.Object org.jargp.StringTracker
StringTracker | public class StringTracker (Code) | | String tracker for processing an array of strings. This is effectively a
specialized iterator for processing an array of strings one at a time.
author: Dennis M. Sosnoski version: 1.0 |
Method Summary | |
public int | countRemaining() Get count of entries remaining. | public boolean | hasNext() Check if another string is available. | public int | length() Get length of array. | public String | next() Get next string from array, advancing past that string. | public int | nextOffset() Get position of next string in array. | public String | peek() Peek next string from array. |
StringTracker | public StringTracker(String[] source, int offset)(Code) | | Constructor
Parameters: source - array supplying string data Parameters: offset - initial string position within source array |
countRemaining | public int countRemaining()(Code) | | Get count of entries remaining.
remaining number of strings in array |
hasNext | public boolean hasNext()(Code) | | Check if another string is available.
true if a string is available, false if at end |
length | public int length()(Code) | | Get length of array.
total number of strings in array |
nextOffset | public int nextOffset()(Code) | | Get position of next string in array.
offset in array of next string |
peek | public String peek()(Code) | | Peek next string from array. Gets the next string without
advancing the current string position.
next string from array exception: ArrayIndexOutOfBoundsException - if past end of array |
|
|