All Packages Class Hierarchy This Package Previous Next Index
Class com.micronova.util.ITokenizer
java.lang.Object
|
+----com.micronova.util.ITokenizer
- public class ITokenizer
- extends Object
Simple tokenizer for delimited data (such as TAB/NEWLINE-delimited table).
It can also handle multiple quote pairs and escapes.
- Version:
- 1.0
-
_buffer
- buffer used for parsing.
-
_EOF
- returned by _parse() when EOF is read.
-
_map
- character map for characters 0 - 127.
-
BEGINQUOTE
- bitflags for 'begin qoute' characters.
-
ENDQUOTE
- bit flag for 'end quote' characters.
-
ESCAPE
- flag for escape characters (e.g., \)
-
IGNORED
- flag for ignored characters.
-
NONE
- flag for ordinary characters.
-
QUOTECODE
- bit flag for quote pair identifier.
-
SEMISEPARATOR
- flag for semi-separator characters; semi-separators are only significant after a word or quote.
-
SEPARATOR
- flag for separator characters (e.g., TAB)
-
TERMINATOR
- flag for terminator characters (e.g., NEWLINE)
-
ITokenizer()
- Constructs an empty Tokenizer.
-
_parse(Reader)
- Parses and returns 'result' code, setting up the 'buffer'.
-
_processEscape(StringBuffer, char, char)
- Processes escapes.
-
_processQuote(StringBuffer, int, StringBuffer)
- Processes quotes.
-
getRow(Reader)
- Gets a row of words (up to a terminator) as an IStringVector.
-
getTable(Reader)
- Gets all rows (up to EOF) into IStringTable.
-
getWord(Reader)
- Gets the next 'word' from the reader.
-
setCharacters(String, int)
- Set character flag for each one in given string.
NONE
public static final byte NONE
- flag for ordinary characters.
IGNORED
public static final byte IGNORED
- flag for ignored characters.
ESCAPE
public static final byte ESCAPE
- flag for escape characters (e.g., \)
SEPARATOR
public static final byte SEPARATOR
- flag for separator characters (e.g., TAB)
SEMISEPARATOR
public static final byte SEMISEPARATOR
- flag for semi-separator characters; semi-separators are only significant after a word or quote.
TERMINATOR
public static final byte TERMINATOR
- flag for terminator characters (e.g., NEWLINE)
_EOF
protected static final byte _EOF
- returned by _parse() when EOF is read.
BEGINQUOTE
public static final byte BEGINQUOTE
- bitflags for 'begin qoute' characters. Lower bits idenifies the matching pair.
ENDQUOTE
public static final byte ENDQUOTE
- bit flag for 'end quote' characters. Lower bits identifies the matching pair.
QUOTECODE
public static final byte QUOTECODE
- bit flag for quote pair identifier.
_buffer
protected StringBuffer _buffer
- buffer used for parsing.
_map
protected byte _map[]
- character map for characters 0 - 127.
ITokenizer
public ITokenizer()
- Constructs an empty Tokenizer.
setCharacters
public void setCharacters(String s,
int flag)
- Set character flag for each one in given string.
_processQuote
protected void _processQuote(StringBuffer buffer,
int quoteCode,
StringBuffer quoteBuffer)
- Processes quotes. You can replace the buffer content here if necessary.
_processEscape
protected void _processEscape(StringBuffer buffer,
char escapeChar,
char escaped)
- Processes escapes. You can modify the buffer content here if necessary (e.g., to handle '\n' etc.)
_parse
protected int _parse(Reader in)
- Parses and returns 'result' code, setting up the 'buffer'.
getWord
public String getWord(Reader in)
- Gets the next 'word' from the reader.
getRow
public IStringVector getRow(Reader in)
- Gets a row of words (up to a terminator) as an IStringVector.
getTable
public IStringTable getTable(Reader in)
- Gets all rows (up to EOF) into IStringTable.
All Packages Class Hierarchy This Package Previous Next Index