|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--com.ibm.able.AbleObject | +--com.ibm.able.beans.AbleImport
This class provides an interface to external text-file data for Able Beans.
Version Description -------- ----------- 1.0.0 Initial release.
Field Summary | |
static int |
BINARY_FILE
|
protected int |
bufferSize
|
protected int |
curRecIndex
|
protected double[] |
curRecord
|
protected java.lang.String |
dataFileName
|
protected AbleDataSet |
dataSet
|
protected java.lang.String |
delimiters
|
protected boolean |
eofFlag
|
protected java.io.File |
file
|
protected java.lang.String |
fileType
|
protected long |
numEpochs
|
protected int |
numFieldsPerRecord
|
protected long |
numRecords
|
double[] |
outNum
|
java.lang.String[] |
outSym
|
protected boolean |
randomizeData
|
static int |
TEXT_FILE
|
Fields inherited from class com.ibm.able.AbleObject |
changed,
chgSupport,
comment,
dataFlowEnabled,
destBufferConnections,
eventQueue,
fileName,
inputBuffer,
listeners,
logger,
name,
outputBuffer,
parent,
propertyConnectionMgr,
sourceBufferConnections,
state,
stateChgSupport |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
AbleImport()
construct an AbleImport object |
|
AbleImport(java.lang.String aName)
construct an AbleImport object with specified name |
Method Summary | |
void |
close()
close the source file Note: this is a noop now, the entire file is read at open() time |
void |
endOfFile()
tell any listeners that we are at the end of the file |
void |
generateTranslateTemplate()
generate a Translate template based on the .dfn and .dat file contents |
int |
getBufferSize()
get the current DataSet buffer size |
java.lang.String |
getDataFileName()
return the data file name |
AbleDataSet |
getDataSet()
return the data set object |
java.lang.String |
getDelimiters()
get the current delimiters (default is space) |
java.lang.String |
getFileType()
return the file type of the source file (text, binary, etc.) |
long |
getNumEpochs()
Retrieve the number of passes over the data |
int |
getNumFieldsPerRec()
get the number of fields per record in the data file |
long |
getNumRecords()
get the number of records in the data file |
void |
handleAbleEvent(AbleEvent e)
process an AbleEvent sent by another Able bean |
void |
init()
Initialize the Import bean set up the timer (off) and async event processing (disabled) open the file if a file name was specified |
boolean |
isEofFlag()
check whether we are at end of file |
boolean |
isRandomizeData()
|
boolean |
isReady()
indicate whether import dataset is ready to provide data that means the definition file was ready and data file is open |
void |
open()
open the file specfied by dataFileName create a DataSet object and load the data into memory |
void |
process()
process the next record in the source file wrap at end of file and signal eof event |
protected void |
readObject(java.io.ObjectInputStream ois)
Read a serialized object from a file |
void |
reset()
re-initialize (reopen) the file |
void |
setBufferSize(int size)
Set the buffer size, determines whether load the entire file (=0) or just pieces of it (>0) into memory |
void |
setDataFileName(java.lang.String aFileName)
set the data file name |
void |
setDataFlowEnabled(boolean newState)
set the data flow processing processing state of the object |
void |
setDataSet(AbleDataSet newDataSet)
set and open the new data set object |
void |
setDelimiters(java.lang.String delims)
set the current delimiters (default is space) |
void |
setFileType(java.lang.String type)
set the file type of the source file |
void |
setNumFieldsPerRec(int num)
set the number of fields per records in the data file |
void |
setNumRecords(long num)
set the number of records in the source file |
void |
setRandomizeData(boolean state)
|
java.lang.String |
toString()
return a formatted string describing the state of this DataSet |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone,
exportObject,
exportObject,
exportObject,
unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost,
getLog,
setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals,
getRef,
hashCode,
toStub |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int TEXT_FILE
public static final int BINARY_FILE
protected java.lang.String dataFileName
protected int numFieldsPerRecord
protected int bufferSize
protected java.lang.String delimiters
protected java.io.File file
protected java.lang.String fileType
protected long numRecords
protected long numEpochs
public transient double[] outNum
public transient java.lang.String[] outSym
protected transient boolean eofFlag
protected AbleDataSet dataSet
protected double[] curRecord
protected int curRecIndex
protected boolean randomizeData
Constructor Detail |
public AbleImport() throws java.rmi.RemoteException
public AbleImport(java.lang.String aName) throws java.rmi.RemoteException
Method Detail |
public void init() throws java.rmi.RemoteException
public void process() throws java.rmi.RemoteException
public void reset() throws java.rmi.RemoteException
public void open() throws java.rmi.RemoteException, java.io.IOException, java.lang.NumberFormatException
public void close()
public void setFileType(java.lang.String type)
public java.lang.String getFileType()
public void setDataFlowEnabled(boolean newState) throws java.rmi.RemoteException
public void setDelimiters(java.lang.String delims)
public java.lang.String getDelimiters()
public void setNumFieldsPerRec(int num)
public int getNumFieldsPerRec()
public long getNumRecords()
public void setNumRecords(long num)
public void setDataFileName(java.lang.String aFileName)
public java.lang.String getDataFileName()
public void setBufferSize(int size)
public int getBufferSize()
public void handleAbleEvent(AbleEvent e)
public long getNumEpochs()
public boolean isEofFlag()
public boolean isReady()
public void endOfFile()
public void generateTranslateTemplate() throws java.io.IOException
protected void readObject(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException
ios
- The object input stream on the filepublic java.lang.String toString()
public void setDataSet(AbleDataSet newDataSet) throws java.rmi.RemoteException, java.io.IOException, java.lang.NumberFormatException
public AbleDataSet getDataSet()
public void setRandomizeData(boolean state)
public boolean isRandomizeData()
|
ABLE, Version 1.1b | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |