Modifier and Type | Field and Description |
---|---|
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 |
matcher
Regular expression match helper.
|
static String |
QUOTE_CHAR
Quote characters
|
private char[] |
quoteChars
Stores the quotation character
|
private boolean |
quoted
Whether the current token is a quoted string.
|
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 |
---|---|
Tokenizer |
advance()
Moves the iterator forward to the next entry.
|
void |
cleanup()
Perform cleanup.
|
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 |
getStrippedSubstring()
Get the current part as substring
|
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 |
isQuoted()
Test if the current string was quoted.
|
boolean |
valid()
Returns true if the iterator currently points to a valid object.
|
private static final Logging LOG
public static final String QUOTE_CHAR
private char[] quoteChars
private Matcher matcher
private CharSequence input
private int send
private int start
private int end
private int index
private boolean quoted
public void initialize(CharSequence input, int begin, int end)
input
- New string to parse.begin
- Beginend
- Endpublic boolean valid()
Iter
public Tokenizer advance()
Iter
public String getSubstring()
public String getStrippedSubstring()
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 boolean isQuoted()
true
when quoted.public int getStart()
public int getEnd()
public void cleanup()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.