Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

## 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, properties, 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
`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, generateRandomIndices, getAgentFieldList, getBufferSize, getComputeStatistics, getCurrentRecordIndex, getCycleSize, getCycleSizeAsString, getFieldList, getFieldList, getNextRecordBlock, getNextTextRecord, getNormalizedRecordSize, getNumberOfOutputFields, getNumEpochs, getNumRecords, getRecordIndex, getRecordsRead, getStepsPerCycle, init, isAllNumericData, isCycleRelative, isRandomizeData, isReady, process, processAbleEvent, processTimerEvent, quitAll, reset, setBufferSize, setComputeStatistics, setCycleSize, setDefaults, setFieldList, setRandomizeData, setRecordIndex`

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, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getProperties, getProperty, getPropertyChangeListeners, 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, removeProperty, 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, setProperties, setProperty, 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, getProperties, getProperty, getState, getTraceLogger, init, isChanged, process, removeAllConnections, removeProperty, resumeAll, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, setState, setTraceLogger, suspendAll`

Methods inherited from interface com.ibm.able.AbleDataBufferManager
`addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, 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, getPropertyChangeListeners, 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`
  Throws:
    `AbleException`
  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.

  Throws:
    `AbleException`

### getDataFileName

    public java.lang.String getDataFileName()

  Return the data file name - has no extension.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| 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

(C) Copyright IBM Corporation 1999, 2005