public abstract class CharacterSeparatedList extends Object
Modifier and Type | Field and Description |
---|---|
protected static char |
CR
Carriage Return character.
|
protected String |
currentString
Current string being parsed.
|
protected static char |
HT
Horizontal TAB character.
|
protected static char |
LF
Line feed character.
|
protected char |
separator
Characters separator.
|
protected static char |
SP
Space character.
|
Constructor and Description |
---|
CharacterSeparatedList(char separator)
Creates a new instance of
CharacterSeparatedList using the character separator as the
separator character. |
Modifier and Type | Method and Description |
---|---|
protected void |
endParse()
End instructions of the string parsing.
|
protected abstract StringBuilder |
generate(StringBuilder sb)
Generates a String representation.
|
protected abstract void |
initializeNbTokens(int nbTokens)
Set the number of tokens to read.
|
protected abstract void |
newToken(int id,
int start,
int stop)
Read a new token between the given start and stop index and set its id.
|
void |
parse(String str)
Parses the given
String . |
void |
parse(String str,
int start,
int stop)
|
protected static final char CR
protected static final char HT
protected static final char LF
protected char separator
protected static final char SP
public CharacterSeparatedList(char separator)
CharacterSeparatedList
using the character separator
as the
separator character.separator
- the character to treat as characters separator for this listprotected void endParse()
protected abstract StringBuilder generate(StringBuilder sb)
sb
- the StringBuffer
StringBuffer
protected abstract void initializeNbTokens(int nbTokens)
nbTokens
- number of tokensprotected abstract void newToken(int id, int start, int stop)
id
- for the tokenstart
- index of the token begin in the stringstop
- index of the token end in the string