| Access | Constructor and Description |
|---|---|
| public | CharacterIterator(final String
String trough which the iterator iterates. s)Creates a new iterator initialized with the given input string. |
| Modifier and Type | Method and Description |
|---|---|
| public char | |
| public String | |
| public boolean | |
| public char | Returns: Next character.Returns next character in the iteration chain and increase the current position. |
| public char | |
| public int | Returns: current position of the iteratorReturns the current internal position of the iterator. |
| public void | setPosition(int
New position for the iterator. newPosition)Changes the current position to the position. |
| CharacterIterator | back to summary |
|---|---|
| public CharacterIterator(final String s) Creates a new iterator initialized with the given input string.
| |
| current | back to summary |
|---|---|
| public char current() Returns character at the current position.
| |
| getInput | back to summary |
|---|---|
| public String getInput() Returns the input String on which this
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Determines whether there is next character in the iteration chain.
| |
| next | back to summary |
|---|---|
| public char next() Returns next character in the iteration chain and increase the current position.
| |
| peek | back to summary |
|---|---|
| public char peek() Returns the next character without increasing the position. The method does the same as
| |
| pos | back to summary |
|---|---|
| public int pos() Returns the current internal position of the iterator.
| |
| setPosition | back to summary |
|---|---|
| public void setPosition(int newPosition) Changes the current position to the position.
| |