|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.table.data.JCStandardFormatParser
This class takes in a stream of data and parses
it under the assumption it is in "standard"
LiveTable format. It then puts the data into
a JCVectorDataSource
instance.
The standard LiveTable format looks like this:
TABLE 2 4 NOLABEL # 2 rows, 4 columns 1 2 3 4 # row 1 1 2 3 4 # row 2Or, with row and column labels,
TABLE 2 4 'Column 1' 'Column 2' 'Column 3' 'Column 4' 'Row 1' 1 2 3 4 'Row 2' 1 4 9 16 'Row 3' 1 16 81 256
Field Summary | |
protected boolean |
isDebug
Flag indicating whether parsing is in debug mode, which turns on error messages on error out. |
protected boolean |
isLabels
Flag indicating whether data source has labels. |
static int |
PARSE_ERR_COLUMN_LABEL
Enum representing a parsing error involving column labels. |
static int |
PARSE_ERR_DATA_STYLE
Enum representing a parsing error involving data. |
static int |
PARSE_ERR_ROW_LABEL
Enum representing a parsing error involving row labels. |
static int |
PARSE_ERR_VALUE
Enum representing a parsing error involving data values. |
protected StreamTokenizer |
tokenizer
Stream tokenizer used to parse input stream. |
Constructor Summary | |
JCStandardFormatParser()
|
Method Summary | |
protected static void |
displayErrorMessage(StreamTokenizer tokenizer,
int nErrorIndex)
A method to display a parsing error message based on an enum value. |
protected static double |
getNextDouble(StreamTokenizer tokenizer)
Reads the next double value. |
protected void |
initTokenizer(Reader r)
Creates and sets up a valid tokenizer active on the provided stream. |
void |
readAndParse(Reader r,
com.klg.jclass.table.data.JCVectorDataSource ds)
Reads and parses data in standard format and places it inside a LiveTable data source. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected StreamTokenizer tokenizer
public static final int PARSE_ERR_DATA_STYLE
public static final int PARSE_ERR_VALUE
public static final int PARSE_ERR_COLUMN_LABEL
public static final int PARSE_ERR_ROW_LABEL
protected boolean isDebug
protected boolean isLabels
Constructor Detail |
public JCStandardFormatParser()
Method Detail |
protected void initTokenizer(Reader r)
r
- reader open on an active streampublic void readAndParse(Reader r, com.klg.jclass.table.data.JCVectorDataSource ds) throws IOException
readAndParse
in interface JCFileFormatParser
r
- reader open on an active streamds
- JCVectorDataSource
instance to act as a
container for the data read in from r
IOException
protected static double getNextDouble(StreamTokenizer tokenizer) throws IOException
tokenizer
-
IOException
protected static void displayErrorMessage(StreamTokenizer tokenizer, int nErrorIndex)
tokenizer
- nErrorIndex
- JCFormatParserUtil.displayErrorMessage(java.io.StreamTokenizer, java.lang.String)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |