ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.beans
Class AbleImport

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.beans.AbleAbstractImport
              |
              +--com.ibm.able.beans.AbleImport
All Implemented Interfaces:
AbleBean, AbleDataBufferManager, AbleDataSource, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

public class AbleImport
extends AbleAbstractImport
implements java.io.Serializable

This class provides Able beans with access to external text-file data.

An AbleImport will read data from a flat text file. It knows how to create an AbleDataSet which is used by its super-class to handle the file I/O and cacheing logic.

The AbleImport object requires the name of a *.dfn meta-data definition file This definition file is used by the AbleDataSet to create field variables and scan the source data, computing min/mean/max values for continuous fields, creating symbol to index mappings for categorical fields, and creating number to index mappings for discrete fields.

An AbleImport can be used to generate an AbleFilter bean which will translate the data in the manner specified in the meta-data definition file.

An example of a *dfn file follows:

  fieldName      type           usage
 -------------------------------------
  field1         continuous     input
  field2         discrete       output
  field3         categorical    input
  field4         continuous     ignore
  field5         continuous     input
  
where:
  • usage values input, output, and ignore are used when generating filters
  • type continuous is a numeric scalar value over a defined range
  • type discrete is a finite set of numeric values
  • type categorical is a finite set of symbols
  • fieldName is any character string not containing a blank.

    See Also:
    Serialized Form

    Field Summary
    protected  java.lang.String dataFileName
              The dataFileName is the file name with no file extension.
    static java.lang.String defaultName
               
    static java.util.Vector DelimiterChars
              A vector of String elements where each element represents a supported character used to delimit fields in the data source.
    static java.util.Vector DelimiterNames
              A vector of String names for the DelimiterChars Vector.
     
    Fields inherited from class com.ibm.able.beans.AbleAbstractImport
    bufferRecordIndex, bufferSize, computeStatistics, cycleRelative, cycleSize, eof, fieldList, importData, numEpochs, numericData, numFieldsPerRecord, numRecords, outNum, outSym, randomIndices, randomizeData, recordIndex, recordsRead, textData
     
    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, trace
     
    Constructor Summary
    AbleImport()
              Construct a default AbleImport object.
    AbleImport(java.lang.String name)
              Construct an AbleImport object with specified name.
    AbleImport(java.lang.String name, java.lang.String dataFileName)
              Construct an AbleImport object with specified name and file.
     
    Method Summary
    static java.lang.String Copyright()
              Determine the copyright of this class.
     java.lang.String getDataFileName()
              Return the data file name - has no extension.
     java.lang.String getDelimiter()
              Get the current delimiter value.
     void open()
              Open the file specfied by dataFileName.
     void setDataFileName(java.lang.String newName)
              Set the name of the text data file to read.
     void setDelimiter(java.lang.String delim)
              Set the current delimiter value.
     
    Methods inherited from class com.ibm.able.beans.AbleAbstractImport
    close, endOfFile, eof, getAgentFieldList, getBufferSize, getComputeStatistics, getCurrentRecordIndex, getCycleSize, getCycleSizeAsString, getFieldList, getFieldList, getNextRecordBlock, getNormalizedRecordSize, getNumberOfOutputFields, getNumEpochs, getNumRecords, getRecordsRead, getStepsPerCycle, init, isAllNumericData, isCycleRelative, isRandomizeData, isReady, process, processAbleEvent, processTimerEvent, quitAll, reset, setBufferSize, setComputeStatistics, setCycleSize, setDefaults, setFieldList, setRandomizeData
     
    Methods inherited from class com.ibm.able.AbleObject
    addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, handleAbleEvent, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processBufferConnections, processNoEventProcessingEnabledSituation, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeAll, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setDataFlowEnabled, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendAll, suspendEnabledEventProcessing
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface com.ibm.able.AbleBean
    getComment, getLogger, getName, getParent, getState, getTraceLogger, init, isChanged, process, removeAllConnections, resumeAll, setChanged, setComment, setLogger, setName, setParent, setState, setTraceLogger, suspendAll
     
    Methods inherited from interface com.ibm.able.AbleDataBufferManager
    addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setDataFlowEnabled, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer
     
    Methods inherited from interface com.ibm.able.AbleEventListener
    handleAbleEvent
     
    Methods inherited from interface com.ibm.able.AbleEventListenerManager
    addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener
     
    Methods inherited from interface com.ibm.able.AbleEventQueueManager
    flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, quitEnabledEventProcessing, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing
     
    Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
    processNoEventProcessingEnabledSituation
     
    Methods inherited from interface com.ibm.able.AblePropertyChangeManager
    addPropertyChangeListener, addPropertyConnection, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection
     
    Methods inherited from interface com.ibm.able.AbleSerializable
    getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName
     

    Field Detail

    defaultName

    public static final java.lang.String defaultName

    DelimiterChars

    public static final java.util.Vector DelimiterChars
    A vector of String elements where each element represents a supported character used to delimit fields in the data source.

    DelimiterNames

    public static final java.util.Vector DelimiterNames
    A vector of String names for the DelimiterChars Vector. The names can be used for selection from a GUI.

    dataFileName

    protected java.lang.String dataFileName
    The dataFileName is the file name with no file extension.
    Constructor Detail

    AbleImport

    public AbleImport()
               throws AbleException
    Construct a default AbleImport object.

    AbleImport

    public AbleImport(java.lang.String name)
               throws AbleException
    Construct an AbleImport object with specified name.
    Parameters:
    name - A String containing the name used to identify this bean.

    AbleImport

    public AbleImport(java.lang.String name,
                      java.lang.String dataFileName)
               throws AbleException
    Construct an AbleImport object with specified name and file. A convenience method to avoid a separate call to setDataFileName.
    Parameters:
    name - A String containing the name used to identify this bean.
    dataFileName - A String containing the name of the file with no file extension.
    Method Detail

    open

    public void open()
              throws AbleException
    Open the file specfied by dataFileName. Create and open an AbleDataSet object and load the data into memory.
    Overrides:
    open in class AbleAbstractImport
    See Also:
    AbleAbstractImport.open()

    setDelimiter

    public void setDelimiter(java.lang.String delim)
    Set the current delimiter value. More than one delimiter may be specified as the String provided serves as the argument when creating a a StringTokenizer.StringTokenizer(String).

    getDelimiter

    public java.lang.String getDelimiter()
    Get the current delimiter value.

    setDataFileName

    public void setDataFileName(java.lang.String newName)
                         throws AbleException
    Set the name of the text data file to read. If a file has been opened and the name is reset with this method, the open file is closed and the state of this object becomes AbleState.Unitiated.

    getDataFileName

    public java.lang.String getDataFileName()
    Return the data file name - has no extension.

    Copyright

    public static java.lang.String Copyright()
    Determine the copyright of this class.
    Returns:
    A String containing this class's copyright statement.


    ABLE 2.0.0 07/02/2003 10:25:01

    (C) Copyright IBM Corporation 1999, 2003