|
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.AbstractDataSource | +--com.klg.jclass.table.data.AbstractVectorDataSource | +--com.klg.jclass.table.data.JCVectorDataSource | +--com.klg.jclass.table.data.JCInputStreamDataSource
This class is the base for any data source that relies on input from some stream, which includes files, URLs, large Strings, etc.
com.sun.java.util
class.TableDataModel
,
Serialized FormField Summary | |
protected com.klg.jclass.table.data.JCFileFormatParser |
customParser
|
protected int |
dataFormat
|
Fields inherited from class com.klg.jclass.table.data.JCVectorDataSource |
cells, column_labels, columns, is_moving, row_labels, rows |
Fields inherited from class com.klg.jclass.table.data.AbstractDataSource |
listeners |
Constructor Summary | |
protected |
JCInputStreamDataSource()
Subclasses may need to set the stream up before they can call super() , so provide a default ctor
and the ctor() function
to replace the super() call (for example,
JCAppletDataSource ). |
|
JCInputStreamDataSource(InputStream i)
The constructor takes the InputStream and reads
in all the appropriate data. |
|
JCInputStreamDataSource(InputStream i,
int newFormat)
The constructor takes the InputStream and reads
in all the appropriate data. |
|
JCInputStreamDataSource(InputStream i,
com.klg.jclass.table.data.JCFileFormatParser prs)
The constructor takes the InputStream and reads
in all the appropriate data according to the specified parser. |
Method Summary | |
static int |
detectFileFormat(Reader r)
Global method for detecting the format of a file. |
com.klg.jclass.table.data.JCFileFormatParser |
getCustomParser()
Gets the value of the CustomParser property. |
int |
getDataFormat()
Gets the value of the DataFormat property. |
protected void |
read(Reader r)
Reads and parses data from the reader, and places it inside the current data source. |
protected void |
readFromStream(InputStream i)
Reads data from an InputStream . |
void |
setCustomParser(com.klg.jclass.table.data.JCFileFormatParser newParser)
Sets the value of the CustomParser property. |
void |
setDataFormat(int newFormat)
Sets the value of the DataFormat property. |
Methods inherited from class com.klg.jclass.table.data.JCVectorDataSource |
addColumn, addColumn, addRow, addRow, clearCells, deleteColumns, deleteColumns, deleteRows, deleteRows, getCells, getColumnLabels, getLabelValue, getNumColumns, getNumRows, getRowLabels, getTableColumnLabel, getTableDataItem, getTableRowLabel, isCell, isColumnLabel, isLabel, isRowLabel, isValidCell, isValidLabel, moveColumns, moveColumns, moveRows, moveRows, setCell, setCells, setCells, setColumnLabel, setColumnLabels, setColumnLabels, setDataChanged, setLabelValue, setNumColumns, setNumRows, setRowLabel, setRowLabels, setRowLabels |
Methods inherited from class com.klg.jclass.table.data.AbstractVectorDataSource |
createVector, createVector, createVector, createVector, createVector, removeElementsAt, setElementAt, strip |
Methods inherited from class com.klg.jclass.table.data.AbstractDataSource |
addTableDataListener, dispose, fireColumnChanged, fireColumnLabelChanged, fireColumnsAdded, fireColumnsDeleted, fireColumnsMoved, fireDataReset, fireNumColumnsChanged, fireNumRowsChanged, fireRowChanged, fireRowDeleted, fireRowLabelChanged, fireRowsAdded, fireRowsMoved, fireTableDataEvent, fireValueChanged, hasListeners, removeTableDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int dataFormat
protected com.klg.jclass.table.data.JCFileFormatParser customParser
Constructor Detail |
public JCInputStreamDataSource(InputStream i) throws IOException
InputStream
and reads
in all the appropriate data.
i
-
IOException
- An IOException will be thrown if there are any errors
while reading in the data.public JCInputStreamDataSource(InputStream i, int newFormat) throws IOException
InputStream
and reads
in all the appropriate data.
i
- Open input streamnewFormat
- Data format; one of STANDARD
or CSV
IOException
- An IOException will be thrown if there are any errors
while reading in the data.public JCInputStreamDataSource(InputStream i, com.klg.jclass.table.data.JCFileFormatParser prs) throws IOException
InputStream
and reads
in all the appropriate data according to the specified parser.
i
- open input streamprs
- custom parser for this data format
IOException
- An IOException will be thrown if there are any errors
while reading in the data.protected JCInputStreamDataSource()
super()
, so provide a default ctor
and the ctor()
function
to replace the super()
call (for example,
JCAppletDataSource
).
Method Detail |
public int getDataFormat()
DataFormat
property.
The DataFormat
property determines how data will
be parsed by this data source. Valid options include
STANDARD
(for table-style format), CSV
(for
comma-separated values), and CUSTOM
(for custom
formats parsed by a user provided parser).
JCTableEnum.STANDARD
, JCTableEnum.CSV
,
or JCTableEnum.CUSTOM
public void setDataFormat(int newFormat)
DataFormat
property.
The DataFormat
property determines how data will
be parsed by this data source. Valid options include
STANDARD
(for table-style format), CSV
(for
comma-separated values), and CUSTOM
(for custom
formats parsed by a user provided parser).
newFormat
- one of JCTableEnum.STANDARD
, JCTableEnum.CSV
, or
JCTableEnum.CUSTOM
public com.klg.jclass.table.data.JCFileFormatParser getCustomParser()
CustomParser
property.
The CustomParser
property identifies the parser to be
used when the DataFormat
property has been set to CUSTOM
.
The value of this property must be a class that has
implemented the JCFileFormatParser
interface.
JCFileFormatParser
that will be used
to parse datapublic void setCustomParser(com.klg.jclass.table.data.JCFileFormatParser newParser)
CustomParser
property.
The CustomParser
property identifies the parser to be
used when the DataFormat
property has been set to CUSTOM
.
The value of this property must be a class that has
implemented the JCFileFormatParser
interface.
newParser
- the class implementing JCFileFormatParser
that will
be used to parse dataprotected void readFromStream(InputStream i) throws IOException
InputStream
.
i
-
IOException
protected void read(Reader r) throws IOException
r
-
IOException
public static int detectFileFormat(Reader r)
r
-
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |