|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.beans.AbleDataSet
This class describes and reads a text file. It uses an external data set called a definition file *.dfn which describes the field name, type (continuous/discrete/categorical), and usage (input/output/ignore). It reads a block of records specified by bufferSize into a textData vector where each element consists of an array of String objects.
| Field Summary | |
|---|---|
protected boolean |
allNumericData
A boolean indicating whether all fields in the data source are continuous. |
protected int |
bufferSize
An integer specifying the number of records to read from the database table and insert into the textData Vector. |
protected java.lang.String |
delimiter
The delimiter is the character from the DelimiterChars Vector used to separate fields for this text file. |
protected java.util.Vector |
fieldList
A Vector of AbleField elements in order of definition; ie, Vector index equals column number. |
protected java.lang.String |
fileName
The path and file name to the definition and data files to be read. |
protected java.io.BufferedReader |
in
The BufferedReader used to read the file. |
static int |
MAX_BUFFER_SIZE
The maximum number of records which may be read. |
protected long |
numRecords
A long calculated to be the number of records in the database table. |
protected boolean |
ready
A boolean indicating whether the file is ready for processing. |
protected java.util.Vector |
textData
A Vector of String arrays containing records from the file. |
| Constructor Summary | |
|---|---|
AbleDataSet(java.lang.String fileName)
Construct an AbleDataSet object for a given file. |
|
| Method Summary | |
|---|---|
void |
close()
Close the BufferedReader on the data file (if open). |
protected AbleField |
createAbleField(AbleFieldDefinition definition)
Construct a corresponding AbleField from an AbleFieldDefinition. |
void |
displayVariables()
Display the fieldList and its values. |
int |
getBufferSize()
Return the number of records to place in the textData Vector each time a record block is read with readNextRecordBlock. |
java.lang.String |
getDelimiter()
|
java.util.Vector |
getFieldList()
Return a Vector of AbleField objects where each object describes a data column. |
int |
getNumFieldsPerRec()
Return the number of fields in each record. |
long |
getNumRecords()
Return the number of records in this database table. |
java.util.Vector |
getTextData()
Returns a Vector of String[] objects representing all loaded text data. |
boolean |
isAllNumericData()
Returns true if all fields are "continuous", false if any are "discrete" or "categorical"; that is, symbols. |
boolean |
isReady()
Return a boolean indicating whether or not the file is ready for processing. |
void |
loadDataFile()
Load the entire data file from a text file into a vector of String arrays. |
void |
open()
Open the data set definition named fileName. |
void |
readNextRecordBlock()
Read the next n records from a file into a vector of String arrays. |
void |
reopen()
Reopen (recreate) the BufferedReader on the text file. |
void |
setBufferSize(int size)
Set the number of records to place in the textData Vector each time a record block is read with readNextRecordBlock. |
void |
setDelimiter(java.lang.String delimiter)
|
void |
setFieldList(java.util.Vector fieldList)
Set a Vector of AbleField objects where each object describes a data column. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MAX_BUFFER_SIZE
protected java.lang.String fileName
protected transient java.io.BufferedReader in
protected boolean allNumericData
protected java.util.Vector textData
protected java.util.Vector fieldList
protected int bufferSize
protected long numRecords
protected java.lang.String delimiter
protected boolean ready
| Constructor Detail |
public AbleDataSet(java.lang.String fileName)
fileName - A String containing the path and name for the definition
and data file to read.| Method Detail |
public boolean isReady()
isReady in interface AbleImportDatapublic void displayVariables()
protected AbleField createAbleField(AbleFieldDefinition definition)
throws AbleException
definition - An AbleFieldDefinition.
An - exception if the AbleFieldDefinition provided is unsupported.
AbleExceptionpublic int getNumFieldsPerRec()
getNumFieldsPerRec in interface AbleImportData
public void open()
throws AbleException
open in interface AbleImportDataAbleException
public void reopen()
throws AbleException
AbleExceptionpublic void close()
close in interface AbleImportData
public void loadDataFile()
throws AbleException
AbleException
public void readNextRecordBlock()
throws AbleException
readNextRecordBlock in interface AbleImportDataAbleExceptionpublic java.util.Vector getTextData()
getTextData in interface AbleImportDatapublic boolean isAllNumericData()
isAllNumericData in interface AbleImportDatapublic void setBufferSize(int size)
setBufferSize in interface AbleImportDatapublic int getBufferSize()
getBufferSize in interface AbleImportDatapublic java.util.Vector getFieldList()
getFieldList in interface AbleImportDatapublic void setFieldList(java.util.Vector fieldList)
setFieldList in interface AbleImportDatapublic long getNumRecords()
getNumRecords in interface AbleImportDatapublic java.lang.String getDelimiter()
public void setDelimiter(java.lang.String delimiter)
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||