public class FastStringIterator
extends java.lang.Object
Constructor and Description |
---|
FastStringIterator() |
FastStringIterator(java.lang.String line) |
Modifier and Type | Method and Description |
---|---|
int |
countTokens()
Counts the tokens of the current String by iterationg through it.
|
java.lang.String |
getAndSkipRestOfLine()
Fetches the rest of line including the current token.
|
java.lang.String |
getFromPreviousAndSkipRestOfLine()
Fetches the rest of line including the previous token.
|
int |
getIndex() |
boolean |
hasNext()
Tells whether there are still unread tokens in the line.
|
protected boolean |
isBreakCharacter(char c)
Checks whether this character is used as a word boundary.
|
java.lang.String |
next()
Returns the next token.
|
double |
nextDouble()
Reads the next token as a double value
|
int |
nextInt()
Reads the next token as an int value
|
void |
setString(java.lang.String line)
Resets the iterator and places a new input line.
|
void |
skip()
Skips the next token.
|
void |
skipRestOfLine()
Skips all tokens until end of line is reached
After this call
hasNext() returns false. |
public FastStringIterator()
public FastStringIterator(java.lang.String line)
public boolean hasNext()
public void skipRestOfLine()
hasNext()
returns false.public java.lang.String getFromPreviousAndSkipRestOfLine()
hasNext()
returns false.public java.lang.String getAndSkipRestOfLine()
hasNext()
returns false.public int getIndex()
public java.lang.String next()
public void skip()
protected boolean isBreakCharacter(char c)
public double nextDouble()
public int nextInt()
public void setString(java.lang.String line)
FastStringIterator
instance to be reused again and again.public int countTokens()
Copyright © 2014 EsprIT-Systems. All Rights Reserved.