|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--ParseTable
This class parses string row input data into data for a spot element. It is similar to StringTokenizer class except the null is returned for each token field when there are multiple delimiters repeated. Also, for now, a single character is the delimiter.
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file.
| Field Summary | |
private static int |
delim
delimiter character |
private static boolean |
doneFlag
Done parsing flag |
(package private) static java.lang.String |
nullStr
string to return if see a null input string |
(package private) static java.lang.String |
str
Input working string |
private static char[] |
tokBuf
token assembly buf - alloc once |
| Constructor Summary | |
ParseTable(int t)
ParseTable() - constructor to create empty unnamed table |
|
ParseTable(int t,
java.lang.String ns)
ParseTable() - constructor to create empty named table |
|
| Method Summary | |
int |
countTokens(java.lang.String line)
countTokens() - count tokens in the string |
static int |
getAllDelimTokens(java.lang.String line,
java.lang.String[] tokArray,
boolean rmvTrailingWhiteSpaceFlag)
getAllDelimTokens() - get array of all delimited tokens into tokArray[]. |
static int |
getDelimTokens(java.lang.String line,
boolean[] useTokFlag,
java.lang.String[] tokArray,
boolean rmvTrailingWhiteSpaceFlag,
java.lang.String missingDataStr)
getDelimTokens() - get array of delimited tokens into tokArray[]. |
java.lang.String |
getString()
getString() - get current string str |
boolean |
hasMoreTokens()
hasMoreTokens() - return true if more tokens in string |
java.lang.String |
nextToken()
nextToken() - get and return next token. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static java.lang.String str
static java.lang.String nullStr
private static int delim
private static boolean doneFlag
private static char[] tokBuf
| Constructor Detail |
public ParseTable(int t)
t - is delimiter between fields and data in rows
public ParseTable(int t,
java.lang.String ns)
t - is delimiter between fields and data in rowsns - is value to use for "null string"| Method Detail |
public static int getAllDelimTokens(java.lang.String line,
java.lang.String[] tokArray,
boolean rmvTrailingWhiteSpaceFlag)
line - is the source stringtokArray - is the array to return the datarmvTrailingWhiteSpaceFlag - if trailing white space is to be removed
public static int getDelimTokens(java.lang.String line,
boolean[] useTokFlag,
java.lang.String[] tokArray,
boolean rmvTrailingWhiteSpaceFlag,
java.lang.String missingDataStr)
line - is the source stringuseTokFlag - is a list of tokens to get. Set un-needed tokens false to
speedup or all if this is nulltokArray - is the array of returned datarmvTrailingWhiteSpaceFlag - to remove trailing white spacemissingDataStr - to use if missing datapublic int countTokens(java.lang.String line)
line - is string to analyzepublic boolean hasMoreTokens()
public java.lang.String nextToken()
public java.lang.String getString()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||