Modifier and Type | Field and Description |
---|---|
private Pattern |
colSep
Separator pattern.
|
private int |
end
Current positions of result and iterator.
|
private int |
index
Current positions of result and iterator.
|
private CharSequence |
input
Data currently processed.
|
private static Logging |
LOG
Class logger.
|
private Matcher |
m
Regular expression match helper.
|
static String |
QUOTE_CHAR
Quote characters
|
private char[] |
quoteChars
Stores the quotation character
|
private int |
send
Substring to process.
|
private int |
start
Current positions of result and iterator.
|
Constructor and Description |
---|
Tokenizer(Pattern colSep,
String quoteChars)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
advance()
Moves the iterator forward to the next entry.
|
double |
getDouble()
Get current value as double.
|
int |
getEnd()
Get end of token.
|
long |
getLongBase10()
Get current value as long.
|
int |
getStart()
Get start of token.
|
String |
getSubstring()
Get the current part as substring
|
void |
initialize(CharSequence input,
int begin,
int end)
Initialize parser with a new string.
|
boolean |
isEmpty()
Test for empty tokens; usually at end of line.
|
private char |
isQuote(int index)
Detect quote characters.
|
boolean |
valid()
Returns true if the iterator currently points to a valid object.
|
private static final Logging LOG
private Pattern colSep
public static final String QUOTE_CHAR
private char[] quoteChars
private Matcher m
private CharSequence input
private int send
private int start
private int end
private int index
public void initialize(CharSequence input, int begin, int end)
input
- New string to parse.begin
- Beginend
- Endpublic boolean valid()
Iter
public void advance()
Iter
public String getSubstring()
public double getDouble() throws NumberFormatException
NumberFormatException
- when current value cannot be parsed as double
value.public long getLongBase10() throws NumberFormatException
NumberFormatException
- when current value cannot be parsed as long
value.public boolean isEmpty()
private char isQuote(int index)
index
- Position1
when a quote character, 0
otherwise.public int getStart()
public int getEnd()