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

com.ibm.able.beans
Class AbleDataTable

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

public class AbleDataTable
extends AbleObject
implements java.io.Serializable

Class to maintain a set of tabular data, maintained in named columns (represented internally as an array of AbleDataSeries). The constructors allow the data to be added one record at a time, or via a String[] of records, or by reading a space (0x20), tab (0x09) or comma (0x2c) delimited data (similar to what you'd pass to a Spreadsheet or Database import facility). The data may comprise Integer, Double, or Strings which are maintained internally as int[], double[], or String[] in the AbleDataSeries. Using native variable types improves speed when calculating statistics on numeric information (e.g., min, max, average, standard deviation). Columns of data may be retrieved as native arrays or as AbleDataSeries. When retrieved as an array of doubles (double[]), the columnar data may be used with the AbleDataAnalytics methods in the com.ibm.able.rules package. This enables time series analysis of the data if one of the columns represents time ordering (as some sorted, monotonically numeric increasing value). The class provides an option to maintain history as values are added, or to defer calculation of statistics until they are requested. Once calculated, if no changes are made to the values, no calculation is necessary. Until locked, the history grows in increments to expand the capacity to reduce array copying. Once locked, new additions overwrite the oldest value in the history.

See Also:
AbleDataSeries, AbleDataAnalytics, Serialized Form

Field Summary
static java.lang.Class classClass
          Class used to signify the initial object passed to identify the "kind" of data to be maintained is not acceptable (e.g., not an Integer, Double or String).
static java.lang.Class classDouble
          Class used to signify the values in a column are doubles, and implies the content of the array in the column's DataSeries is being maintained internally is a double[].
static java.lang.Class classDoubleArray
          Class used to signify the values in the column's DataSeries are being maintained internally is a double[].
static java.lang.Class classIntArray
          Class used to signify the values in the column's DataSeries are being maintained internally is an int[].
static java.lang.Class classInteger
          Class used to signify the values in a column are ints, and implies the content of the array in the column's DataSeries is being maintained internally is an int[].
static java.lang.Class classString
          Class used to signify the values in a column are Strings, and implies the content of the array in the column's DataSeries is being maintained internally is a String[].
static java.lang.Class classStringArray
          Class used to signify the values in the column's DataSeries are being maintained internally is a String[].
static boolean DEFAULT_CALC_ON_ADD
          Set to false, the default value for whether (true) or not (false) calculations should be performed each time a value is added to the history of this DataTable.
static java.lang.String DEFAULT_DELIMITER_STRING
          Set to " \t,", this is the String used to parse input records to find fields (titles or data values).
static boolean DEFAULT_HAS_TITLES
          Set to true, the default value for whether (true) or not (false) files are expected to contain the column titles (DataSeries names) as delimited fields their first record.
static int DEFAULT_HISTORY_SIZE
          Set to 10, this is the default number of rows allocated during construction unless a parameter is used to specify otherwise during construction.
static int INVALID_INDEX
          Equal to -1, this is used to signal an invalid index for operations expecting to return an index to information (typically uesd when none is available or when an error has occurred).
static int MAX_RECORD_SIZE
          Equal to 4096, this is used to limit the number of bytes read for a single "record" containing delimited data to be added to this DataTable.
static java.lang.String strUnknown
          Set to "Unknown", this is the default name used for an unnamed DataTable.
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleDataTable(double dColCount)
          Constructor allowing objects to be constructed with the specified number of columns.
AbleDataTable(double dColCount, boolean bCalcOnAdd)
          Constructor allowing objects to be constructed with the specified number of columns.
AbleDataTable(int iColCount)
          Constructor allowing objects to be constructed with the specified number of columns.
AbleDataTable(int iColCount, boolean bCalcOnAdd)
          Constructor allowing objects to be constructed with the specified number of columns.
AbleDataTable(java.lang.String strFileName)
          Constructor allowing objects to be constructed with the content of the specified file.
AbleDataTable(java.lang.String[] strRecordArray, boolean bHasTitles, boolean bCalcOnAdd)
          Constructor allowing objects to be constructed with the content of the specified String[].
AbleDataTable(java.lang.String strFileName, boolean bHasTitles, boolean bCalcOnAdd)
          Constructor allowing objects to be constructed with the content of the specified file.
 
Method Summary
 boolean addRow(java.lang.Object[] rowData)
          Method to add a row of data Objects contained in the supplied Object[].
 boolean addRow(java.util.Vector rowData)
          Method to add a row of data Objects contained in the supplied Vector.
 java.lang.Double append(AbleDataTable tableToAppend)
          Append the contents of one DataTable to the front of this DataTable's history (e.g., as newer data).
static java.lang.String Copyright()
          Determine the copyright of this class.
 boolean duplicateColumn(double dCol, java.lang.String strNewTitle)
          Method to duplicate one column, and create another in this DataTable.
 boolean duplicateColumn(int iCol, java.lang.String strNewTitle)
          Method to duplicate one column, and create another in this DataTable.
 boolean duplicateColumn(java.lang.String strColumnName, java.lang.String strNewTitle)
          Method to duplicate one column, and create another in this DataTable.
 java.util.Vector findRow(double dCol, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRow(int iCol, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRow(java.lang.String strColumnName, java.lang.Double value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRow(java.lang.String strColumnName, java.lang.Integer value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRow(java.lang.String strColumnName, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRow(java.lang.String strColumnName, java.lang.String value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRowInSortedColumn(double dCol, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRowInSortedColumn(int iCol, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 java.util.Vector findRowInSortedColumn(java.lang.String strColumnName, java.lang.Object value)
          Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector.
 boolean getCalcOnAdd()
          Returns the boolean value of the m_bCalcOnAdd flag.
 int getCapacity()
          Return the potential row capacity for entries in this DataTable as an int.
 java.util.Vector getColumn(int iCol)
          Method to return the content of a named column as a Vector of Java Objects corresponding with the columns data type.
 java.util.Vector getColumn(java.lang.String strColumnName)
          Method to return the content of a named column as a Vector of Java Objects corresponding with the columns data type.
 double[] getColumnAsDoubleArray(int iCol)
          Method to return the content of a named column as a double[].
 double[] getColumnAsDoubleArray(java.lang.String strColumnName)
          Method to return the content of a named column as a double[].
 java.util.Vector getColumnAsDoubleVector(int iCol)
          Method to return the content of a named column as a Vector of Doubles.
 java.util.Vector getColumnAsDoubleVector(java.lang.String strColumnName)
          Method to return the content of a named column as a Vector of Doubles.
 int[] getColumnAsIntArray(int iCol)
          Method to return the content of a named column as an int[].
 int[] getColumnAsIntArray(java.lang.String strColumnName)
          Method to return the content of a named column as an int[].
 java.lang.String[] getColumnAsStringArray(int iCol)
          Method to return the content of a named column as a String[].
 java.lang.String[] getColumnAsStringArray(java.lang.String strColumnName)
          Method to return the content of a named column as a String[].
 double getColumnAverage(int iCol)
          Returns the average of the values in the specified column.
 java.lang.Double getColumnAverage(java.lang.String strColumnName)
          Returns the average of the values in the specified column.
 java.lang.Class getColumnClass(int iCol)
          Return the Class describing the data stored in this column's DataSeries.
 java.lang.Class getColumnClass(java.lang.String strColumnName)
          Return the Class describing the data stored in this column's DataSeries.
 int getColumnCount()
          Method to return the number of columns in this DataTable.
 int getColumnIndex(java.lang.String strColumnName)
          Method to return the column number (0-based index) for the named column.
 double getColumnMaximum(int iCol)
          Returns the maximum of the values in the specified column.
 double getColumnMaximum(java.lang.String strColumnName)
          Returns the maximum of the values in the specified column.
 double getColumnMinimum(int iCol)
          Returns the minimum of the values in the specified column.
 double getColumnMinimum(java.lang.String strColumnName)
          Returns the minimum of the values in the specified column.
 double getColumnStdDeviation(int iCol)
          Returns the standard deviation of the values in the specified column.
 double getColumnStdDeviation(java.lang.String strColumnName)
          Returns the standard deviation of the values in the specified column.
 double getColumnSum(int iCol)
          Returns the sum of the values in the specified column.
 double getColumnSum(java.lang.String strColumnName)
          Returns the sum of the values in the specified column.
 java.lang.String getColumnTitle(int iCol)
          Method to return the specified column's name
 java.lang.String[] getColumnTitlesByColumn()
          Method to return the titles of all this DataTable's columns in their numeric order (e.g., left (0) to right (m_iCols)).
 java.lang.String[] getColumnTitlesByName()
          Method to return the titles of all this DataTable's columns in their name order (e.g., alphabetic sort order).
 double getColumnVariance(int iCol)
          Returns the variance of the values in the specified column.
 double getColumnVariance(java.lang.String strColumnName)
          Returns the variance of the values in the specified column.
 AbleDataSeries getDataSeries(int iCol)
          Method to return the content of a named column as a DataSeries.
 AbleDataSeries getDataSeries(java.lang.String strColumnName)
          Method to return the content of a named column as a DataSeries.
 AbleDataTable getDataTable(boolean bCalcOnAdd)
          Method to create a new DataTable from the existing DataTable All aspects of this DataTable, including its name are retained in the new one with the exception of whether or not statistical calculations are to be performed when rows are added to the DataTable being returned.
 AbleDataTable getDataTable(int[] indexArray)
          Method to create a new DataTable from the existing DataTable based on a subset of row indices.
 AbleDataTable getDataTable(int[] indexArray, boolean bCalcOnAdd)
          Method to create a new DataTable from the existing DataTable based on a subset of row indices.
 AbleDataTable getDataTable(int iCol, java.lang.Object from, java.lang.Object thru, boolean bIsSorted)
          Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column.
 AbleDataTable getDataTable(java.lang.Object indexArrayObj)
          Method to create a new DataTable from the existing DataTable based on a subset of row indices passed in an object.
 AbleDataTable getDataTable(java.lang.String strColumnName, java.lang.Double DFrom, java.lang.Double DThru, boolean bIsSorted)
          Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column.
 AbleDataTable getDataTable(java.lang.String strColumnName, java.lang.Object objFrom, java.lang.Object objThru, boolean bIsSorted)
          Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column.
 AbleDataTable getDataTable(java.lang.String strColumnName, java.lang.String strFrom, java.lang.String strThru, boolean bIsSorted)
          Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column.
static AbleDataTable getDataTableFromFile(java.lang.String strFileName)
          Static utility method to create a new AbleDataTable with data values read from the specified file.
static AbleDataTable getDataTableFromFile(java.lang.String strFileName, java.lang.Boolean BHasTitles, java.lang.Boolean BCalcOnAdd)
          Static utility metho allowing a new AbleDataTable to be constructed with the content of the specified file.
 java.util.Vector getRow(int iRow)
          Method to return the row specified by the supplied number.
 int getRowCount()
          Method to return the number of rows in this DataTable.
 java.lang.Class[] getTypeClassesByColumn()
          Method to return the Classes of all this DataTable's columns in their column numeric order (e.g., left (0) to right (m_iCols)).
 java.lang.String[] getTypesByColumn()
          Method to return the types (names of Classes) of all this DataTable's columns in their column numeric order (e.g., left (0) to right (m_iCols)).
 boolean isLocked()
          Method to return locked state of this object
 AbleDataTable loadFromFile(java.lang.String strFileName)
          Utility method to create and fill a new DataTable with the contents of a specified file.
 AbleDataTable loadFromFile(java.lang.String strFileName, boolean bHasTitles, boolean bCalcOnAdd)
          Utility method to create and fill a new DataTable with the contents of a specified file.
 AbleDataTable loadFromFile(java.lang.String strFileName, java.lang.Boolean BHasTitles, java.lang.Boolean BCalcOnAdd)
          Utility method to create and fill a new DataTable with the contents of a specified file.
 void lock()
           
protected  boolean replaceColArray(AbleDataSeries[] colArray)
          Method to replace the current content of this DataTable with another set of columns.
 boolean saveToFile(java.lang.String strFileName, java.lang.String strDelimiter)
          Method to save the content of this DataTable to a delimited text file, including the column titles in the first record written.
 boolean saveToFile(java.lang.String strFileName, java.lang.String strDelimiter, boolean bOverwrite)
          Method to save the content of this DataTable to a delimited text file, including the column titles in the first record written.
 void setCalcOnAdd(boolean bCalcOnAdd)
          Allows one to control the value of the m_bCalcOnAdd flag describing whether (true) or not (false) statistical calculations are performed when values are added to the history maintained by this object.
 void setCapacity(int iCapacity)
          Method to alter the size of the history maintained by this object.
 boolean setCell(int iRow, int iCol, java.lang.Object objInput)
          Method to set the specified "cell" in this DataTable to the value in the object passed.
 boolean setColumn(int iCol, AbleDataSeries colSeries)
          Method to set the specified column's data values to those in the supplied DataSeries.
 boolean setColumn(int iCol, java.lang.Object[] colData)
          Method to set the specified column's data values to those in the supplied Object[].
 boolean setColumn(int iCol, java.util.Vector colData)
          Method to set the specified column's data values to those in the supplied Vector.
 boolean setColumnSelectedToValue(int iCol, int[] selectRows, java.lang.Object colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnSelectedToValue(java.lang.String strColumnName, int[] selectRows, java.lang.Double colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnSelectedToValue(java.lang.String strColumnName, int[] selectRows, java.lang.Integer colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnSelectedToValue(java.lang.String strColumnName, int[] selectRows, java.lang.Object colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnSelectedToValue(java.lang.String strColumnName, int[] selectRows, java.lang.String colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnSelectedToValue(java.lang.String strColumnName, java.lang.Object selectRows, java.lang.Double colData)
          Method to set the specified column's data values to the supplied value.
 void setColumnTitle(int iCol, java.lang.String strTitle)
          Method to set a specified columns title to the specified String
 void setColumnTitle(java.lang.String strColumnName, java.lang.String strTitle)
          Method to set a specified columns title to the specified String
 void setColumnTitles(java.lang.String[] titleList)
          Method to revise the current titles for the DataTable's columns using the content of the passed String[].
 void setColumnTitles(java.util.Vector titleList)
          Method to revise the current titles for the DataTable's columns using the content of the passed Vector.
 boolean setColumnToValue(int iCol, java.lang.Object colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnToValue(java.lang.String strColumnName, java.lang.Double colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnToValue(java.lang.String strColumnName, java.lang.Integer colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnToValue(java.lang.String strColumnName, java.lang.Object colData)
          Method to set the specified column's data values to the supplied value.
 boolean setColumnToValue(java.lang.String strColumnName, java.lang.String colData)
          Method to set the specified column's data values to the supplied value.
 void setLocked(boolean bLocked)
          Method to set locked state of this object.
 boolean setRow(java.lang.Double DRow, java.util.Vector rowData)
          Method to update a rows contents with the data passed in the Vector.
 boolean setRow(int iRow, java.lang.Object[] rowData)
          Method to update a rows contents with the data passed in the Object[].
 boolean setRow(int iRow, java.util.Vector rowData)
          Method to update a rows contents with the data passed in the Vector.
 boolean setTypeClasses(java.lang.Class[] classTypes)
          Method to alter the column storage method (and potentially, their contents) to match the specified Class.
 void unlock()
          Method to unlock this DataTable to allow history expansion when new values are added.
 
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, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, quitAll, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, reset, 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
 

Field Detail

classClass

public static final java.lang.Class classClass
Class used to signify the initial object passed to identify the "kind" of data to be maintained is not acceptable (e.g., not an Integer, Double or String). No history will be maintained for anything except Integers, Doubles, or Strings.
See Also:
classDouble, classInteger, classString

classDouble

public static final java.lang.Class classDouble
Class used to signify the values in a column are doubles, and implies the content of the array in the column's DataSeries is being maintained internally is a double[]. When objects are added to columns in this class, their Java Class is compared against this value to see if conversion is necessary.

classDoubleArray

public static final java.lang.Class classDoubleArray
Class used to signify the values in the column's DataSeries are being maintained internally is a double[]. When objects are added to columns in this class, their Java Class is examined to see if conversion is necessary.
See Also:
classDouble

classIntArray

public static final java.lang.Class classIntArray
Class used to signify the values in the column's DataSeries are being maintained internally is an int[]. When objects are added to columns in this class, their Java Class is examined to see if conversion is necessary.
See Also:
classInteger

classInteger

public static final java.lang.Class classInteger
Class used to signify the values in a column are ints, and implies the content of the array in the column's DataSeries is being maintained internally is an int[]. When objects are added to columns in this class, their Java Class is compared against this value to see if conversion is necessary.

classString

public static final java.lang.Class classString
Class used to signify the values in a column are Strings, and implies the content of the array in the column's DataSeries is being maintained internally is a String[]. When objects are added to columns in this class, their Java Class is compared against this value to see if conversion is necessary.

classStringArray

public static final java.lang.Class classStringArray
Class used to signify the values in the column's DataSeries are being maintained internally is a String[]. When objects are added to columns in this class, their Java Class is examined to see if conversion is necessary.
See Also:
classString

DEFAULT_CALC_ON_ADD

public static final boolean DEFAULT_CALC_ON_ADD
Set to false, the default value for whether (true) or not (false) calculations should be performed each time a value is added to the history of this DataTable. When loading large amounts of data into a DataTable, it is best to use false for performance reasons. The DataTable's setting can be changed using the setCalcOnAdd method. It can be interrogated with the getCalcOnAdd method.
See Also:
getCalcOnAdd(), setCalcOnAdd(boolean)

DEFAULT_DELIMITER_STRING

public static final java.lang.String DEFAULT_DELIMITER_STRING
Set to " \t,", this is the String used to parse input records to find fields (titles or data values).

DEFAULT_HAS_TITLES

public static final boolean DEFAULT_HAS_TITLES
Set to true, the default value for whether (true) or not (false) files are expected to contain the column titles (DataSeries names) as delimited fields their first record.
See Also:
DEFAULT_DELIMITER_STRING

DEFAULT_HISTORY_SIZE

public static final int DEFAULT_HISTORY_SIZE
Set to 10, this is the default number of rows allocated during construction unless a parameter is used to specify otherwise during construction.

INVALID_INDEX

public static final int INVALID_INDEX
Equal to -1, this is used to signal an invalid index for operations expecting to return an index to information (typically uesd when none is available or when an error has occurred).

MAX_RECORD_SIZE

public static final int MAX_RECORD_SIZE
Equal to 4096, this is used to limit the number of bytes read for a single "record" containing delimited data to be added to this DataTable. Records are read in buffers to improve performance and this is the size of the buffer. A buffer may contain multiple records.

strUnknown

public static final java.lang.String strUnknown
Set to "Unknown", this is the default name used for an unnamed DataTable. The DataTable can be named after construction using the setName method.
See Also:
AbleObject.setName(java.lang.String)
Constructor Detail

AbleDataTable

public AbleDataTable(double dColCount)
Constructor allowing objects to be constructed with the specified number of columns.
Parameters:
dColCount - The number of columns to be maintained by this DataTable.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataTable

public AbleDataTable(double dColCount,
                     boolean bCalcOnAdd)
              throws java.rmi.RemoteException
Constructor allowing objects to be constructed with the specified number of columns. The caller can also specify whether or not statistical calculations should be performed when rows are added to the DataTable.
Parameters:
dColCount - The number of columns to be maintained by this DataTable.
bCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.

AbleDataTable

public AbleDataTable(int iColCount)
Constructor allowing objects to be constructed with the specified number of columns.
Parameters:
iColCount - The number of columns to be maintained by this DataTable.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataTable

public AbleDataTable(int iColCount,
                     boolean bCalcOnAdd)
Constructor allowing objects to be constructed with the specified number of columns. The caller can also specify whether or not statistical calculations should be performed when rows are added to the DataTable.
Parameters:
iColCount - The number of columns to be maintained by this DataTable.
bCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.

AbleDataTable

public AbleDataTable(java.lang.String strFileName)
Constructor allowing objects to be constructed with the content of the specified file. The file is expected to have space, tab, or comma delimited data. It is also expected to have its first row containing the column names.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
See Also:
DEFAULT_CALC_ON_ADD, DEFAULT_HAS_TITLES

AbleDataTable

public AbleDataTable(java.lang.String strFileName,
                     boolean bHasTitles,
                     boolean bCalcOnAdd)
Constructor allowing objects to be constructed with the content of the specified file. The caller can specify whether or not the file is expected to have its first row containing the column names.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
bHasTitles - specifies whether (true) or not (false) the file being read contains column titles in its first row.
bCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.

AbleDataTable

public AbleDataTable(java.lang.String[] strRecordArray,
                     boolean bHasTitles,
                     boolean bCalcOnAdd)
Constructor allowing objects to be constructed with the content of the specified String[]. The caller can specify whether or not the file is expected to have its first row containing the column names.
Parameters:
strRecordArray - the array or Strings containing records to fill this DataTable.
bHasTitles - specifies whether (true) or not (false) the file being read contains column titles in its first row.
bCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.
Method Detail

Copyright

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

getDataTableFromFile

public static AbleDataTable getDataTableFromFile(java.lang.String strFileName)
Static utility method to create a new AbleDataTable with data values read from the specified file. The file is expected to have column titles in its first row.
Parameters:
strFileName - The String containing the file (and optionally the path) from which data will be read to fill the content of a new AbleDataTable.
Returns:
An AbleDataTable constructed from the content of the specified file. If the AbleDataTable can't be constructed, it will return null.

getDataTableFromFile

public static AbleDataTable getDataTableFromFile(java.lang.String strFileName,
                                                 java.lang.Boolean BHasTitles,
                                                 java.lang.Boolean BCalcOnAdd)
Static utility metho allowing a new AbleDataTable to be constructed with the content of the specified file. The caller can specify whether or not the file is expected to have its first row containing the column names.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
BHasTitles - specifies whether (true) or not (false) the file being read contains column titles in its first row.
BCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.
Returns:
An AbleDataTable constructed from the content of the specified file. If the AbleDataTable can't be constructed, a null is returned. If an error is encountered reading the file, then an empty AbleDataTable (new AbleDataTable(0)) is returned.

addRow

public boolean addRow(java.lang.Object[] rowData)
Method to add a row of data Objects contained in the supplied Object[].
Parameters:
rowData - An Object[] containing the Objects to be added as a new row in this DataTable. If this DataTable is locked, then the new row will overwrite the oldest entry in the history. This method is synchronized.
Returns:
boolean to show success (true) or failure (false).

addRow

public boolean addRow(java.util.Vector rowData)
Method to add a row of data Objects contained in the supplied Vector.
Parameters:
rowData - A Vector containing the Objects to be added as a new row in this DataTable. If this DataTable is locked, then the new row will overwrite the oldest entry in the history. This method uses the synchronized addRow(Object[]) method.
Returns:
boolean to show success (true) or failure (false).
See Also:
addRow(java.lang.Object[])

append

public java.lang.Double append(AbleDataTable tableToAppend)
Append the contents of one DataTable to the front of this DataTable's history (e.g., as newer data). This method is synchronized. Returns the number of rows appended as a Double. For example, if this DataTable contains 3 rows, with a column containing a "A", "B", and "C" representing the first, second, and last (newest) rows added, and if we append another DataTable with similar format, but having "D", and "E", where "E" was in the newest row added, then the result would be to have the following sequence in the new column of 5 entries: "A", "B", "C", "D", "E" from the oldest to newest value.
Parameters:
tableToAppend - is a DataTable whose contents will be appended (added to) the front of the history maintained by this DataTable. Note the DataTable much contain the same number and types of columnar data (e.g., the column names much match, and the method of storage within the columns must match).
Returns:
The count of rows ofdata appended as a Double. Note, if the value returned is not equal to the getRowCount() of the DataTable passed, an error occurred.

duplicateColumn

public boolean duplicateColumn(double dCol,
                               java.lang.String strNewTitle)
Method to duplicate one column, and create another in this DataTable. The new column receives the specified title. This method uses the synchronized duplicateColumn(int,String) method.
Parameters:
dCol - The column number (0-based index) to be updated.
strNewTitle - The name of the column to be updated.
Returns:
boolean declaring success (true) or failure (false).

duplicateColumn

public boolean duplicateColumn(int iCol,
                               java.lang.String strNewTitle)
Method to duplicate one column, and create another in this DataTable. The new column receives the specified title. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be updated.
strNewTitle - The name of the column to be updated.
Returns:
boolean declaring success (true) or failure (false).

duplicateColumn

public boolean duplicateColumn(java.lang.String strColumnName,
                               java.lang.String strNewTitle)
Method to duplicate one column, and create another in this DataTable. The new column receives the specified title. This method uses the synchronized duplicateColumn(int,String) method.
Parameters:
strColumnName - The name of the column to be updated.
strNewTitle - The name of the column to be updated.
Returns:
boolean declaring success (true) or failure (false).

findRow

public java.util.Vector findRow(double dCol,
                                java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRow(int,Object) method. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
dCol - The column number (0-based index) to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRow

public java.util.Vector findRow(int iCol,
                                java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method is synchronized. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
iCol - The column number (0-based index) to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRow

public java.util.Vector findRow(java.lang.String strColumnName,
                                java.lang.Double value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRow(int,Object) method. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
strColumnName - The name of the column to be searched for the matching value to what was passed.
value - A Double used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRow

public java.util.Vector findRow(java.lang.String strColumnName,
                                java.lang.Integer value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRow(int,Object) method. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
strColumnName - The name of the column to be searched for the matching value to what was passed.
value - An Integer used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRow

public java.util.Vector findRow(java.lang.String strColumnName,
                                java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRow(int,Object) method. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
strColumnName - The name of the column to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRow

public java.util.Vector findRow(java.lang.String strColumnName,
                                java.lang.String value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRow(int,Object) method. This method does not assume the column being searched is sorted, so it will scan from the beginning to end (oldest to newest values) and return the first match it encounters.
Parameters:
strColumnName - The name of the column to be searched for the matching value to what was passed.
value - A String used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRowInSortedColumn

public java.util.Vector findRowInSortedColumn(double dCol,
                                              java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRowInSortedColumn(int,Object) method. This method assumes the column being searched is sorted, so it will use a binary search. If there are multiple equal values then it is undefined which row within this set of equal values will be returned.
Parameters:
dCol - The column number (0-based index) to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRowInSortedColumn

public java.util.Vector findRowInSortedColumn(int iCol,
                                              java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method is synchronized. This method assumes the column being searched is sorted, so it will use a binary search. If there are multiple equal values then it is undefined which row within this set of equal values will be returned.
Parameters:
iCol - The column number (0-based index) to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

findRowInSortedColumn

public java.util.Vector findRowInSortedColumn(java.lang.String strColumnName,
                                              java.lang.Object value)
Method to find the row containing the supplied value in the the supplied column, and return that row as a Vector. This method uses the synchronized findRowInSortedColumn(int,Object) method. This method assumes the column being searched is sorted, so it will use a binary search. If there are multiple equal values then it is undefined which row within this set of equal values will be returned.
Parameters:
strColumnName - The name of the column to be searched for the matching value to what was passed.
value - An Object used to compare against the content of the specified column. If matched, the content of its row in this DataTable is returned as a Vector.
Returns:
A Vector containing the Objects in the row matching the search criteria (value in the specified column matches). If no row can be found matching the search critera, an empty vector (new Vector(0)) is returned.

getCalcOnAdd

public boolean getCalcOnAdd()
Returns the boolean value of the m_bCalcOnAdd flag.
Returns:
Returns a boolean describing whether (true) or not (false) statistical calculations are performed when values are added to the history maintained by this object.

getCapacity

public int getCapacity()
Return the potential row capacity for entries in this DataTable as an int.
Returns:
int containing the maximium row storage allowed in this DataTable before capacity is increased, or until data wraps on itself if the DataTable is locked.

getColumn

public java.util.Vector getColumn(int iCol)
Method to return the content of a named column as a Vector of Java Objects corresponding with the columns data type. This method is synchronized.
Parameters:
iCol - The column number (0-based index) whose contents are to be retrieved.
Returns:
A Vector containing the Java Objects corresponding to the values containined in the specified column.

getColumn

public java.util.Vector getColumn(java.lang.String strColumnName)
Method to return the content of a named column as a Vector of Java Objects corresponding with the columns data type. This method uses the synchronized getColumn(int) method.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
A Vector containing the Java Objects corresponding to the values containined in the specified column.

getColumnAsDoubleArray

public double[] getColumnAsDoubleArray(int iCol)
Method to return the content of a named column as a double[]. This method is synchronized.
Parameters:
iCol - The name column number (0-based index) whose contents are to be retrieved.
Returns:
A double[] corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned. Values are converted where possible into doubles. Unconvertable values are returned as 0.0.

getColumnAsDoubleArray

public double[] getColumnAsDoubleArray(java.lang.String strColumnName)
Method to return the content of a named column as a double[]. This method uses the synchronized getColumnAsDoubleArray(int) method.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
A double[] corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned. Values are converted where possible into doubles. Unconvertable values are returned as 0.0.

getColumnAsDoubleVector

public java.util.Vector getColumnAsDoubleVector(int iCol)
Method to return the content of a named column as a Vector of Doubles. This method is synchronized.
Parameters:
iCol - The column number (0-based index) whose contents are to be retrieved.
Returns:
A Vector of Doubles corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned. Values are converted where possible into doubles. Unconvertable values are returned as 0.0.

getColumnAsDoubleVector

public java.util.Vector getColumnAsDoubleVector(java.lang.String strColumnName)
Method to return the content of a named column as a Vector of Doubles. This method uses the synchronized getColumnAsDoubleList(int) method.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
A Vector of Doubles corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned. Values are converted where possible into doubles. Unconvertable values are returned as 0.0.

getColumnAsIntArray

public int[] getColumnAsIntArray(int iCol)
Method to return the content of a named column as an int[]. This method is synchronized.
Parameters:
iCol - The column number (0-based index) whose contents are to be retrieved.
Returns:
An int[] corresponding to the specified column. If the specified column is in error, an empty int[0] is returned.

getColumnAsIntArray

public int[] getColumnAsIntArray(java.lang.String strColumnName)
Method to return the content of a named column as an int[]. This method uses the synchronized getColumnAsIntArray(int) method.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
An int[] corresponding to the specified column. If the specified column is in error, an empty int[0] is returned.

getColumnAsStringArray

public java.lang.String[] getColumnAsStringArray(int iCol)
Method to return the content of a named column as a String[]. This method is synchronized.
Parameters:
iCol - The column number (0-based index) whose contents are to be retrieved.
Returns:
A String[] corresponding to the specified column. If the specified column is in error, an empty String[0] is returned.

getColumnAsStringArray

public java.lang.String[] getColumnAsStringArray(java.lang.String strColumnName)
Method to return the content of a named column as a String[]. This method uses the synchronized getColumnAsStringArray(int) method.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
A String[] corresponding to the specified column. If the specified column is in error, an empty String[0] is returned.

getColumnAverage

public double getColumnAverage(int iCol)
Returns the average of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose average is to be returned.
Returns:
Returns a double containing the average of the values found in the specified column.

getColumnAverage

public java.lang.Double getColumnAverage(java.lang.String strColumnName)
Returns the average of the values in the specified column.
Parameters:
strColumnName - The name of the column whose average is to be returned.
Returns:
Returns a Double containing the average of the values found in the specified column.

getColumnClass

public java.lang.Class getColumnClass(int iCol)
Return the Class describing the data stored in this column's DataSeries. Note that internally the data are stored in int[], double[], or String[], but the Class reported is the Object version of the native types (e.g., Integer for int, and Double for double), or String if stored in a String[].
Parameters:
iCol - is the number (0-based index) of the column whose class you wish to know.
Returns:
Class that will match one of the following: classInteger, classDouble, or classString for comparison purposes.
See Also:
classInteger, classDouble, classString

getColumnClass

public java.lang.Class getColumnClass(java.lang.String strColumnName)
Return the Class describing the data stored in this column's DataSeries. Note that internally the data are stored in int[], double[], or String[], but the Class reported is the Object version of the native types (e.g., Integer for int, and Double for double), or String if stored in a String[].
Parameters:
strColumnName - is the name of the column whose class you wish to know.
Returns:
Class that will match one of the following: classInteger, classDouble, or classString for comparison purposes.
See Also:
classInteger, classDouble, classString

getColumnCount

public int getColumnCount()
Method to return the number of columns in this DataTable.
Returns:
An int containing the number of columns in this DataTable.

getColumnIndex

public int getColumnIndex(java.lang.String strColumnName)
Method to return the column number (0-based index) for the named column.
Parameters:
strColumnName - The name of the column whose index is to be returned.
Returns:
The column number (0-based index) as an int.

getColumnMaximum

public double getColumnMaximum(int iCol)
Returns the maximum of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose maximum is to be returned.
Returns:
Returns a double containing the maximum of the values found in the specified column.

getColumnMaximum

public double getColumnMaximum(java.lang.String strColumnName)
Returns the maximum of the values in the specified column.
Parameters:
strColumnName - The name of the column whose maximum is to be returned.
Returns:
Returns a double containing the maximum of the values found in the specified column.

getColumnMinimum

public double getColumnMinimum(int iCol)
Returns the minimum of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose minimum is to be returned.
Returns:
Returns a double containing the minimum of the values found in the specified column.

getColumnMinimum

public double getColumnMinimum(java.lang.String strColumnName)
Returns the minimum of the values in the specified column.
Parameters:
strColumnName - The name of the column whose minimum is to be returned.
Returns:
Returns a double containing the minimum of the values found in the specified column.

getColumnStdDeviation

public double getColumnStdDeviation(int iCol)
Returns the standard deviation of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose standard deviation is to be returned.
Returns:
Returns a double containing the standard deviation of the values found in the specified column.

getColumnStdDeviation

public double getColumnStdDeviation(java.lang.String strColumnName)
Returns the standard deviation of the values in the specified column.
Parameters:
strColumnName - The name of the column whose standard deviation is to be returned.
Returns:
Returns a Double containing the standard deviation of the values found in the specified column. An error returns Double.MAX_VALUE.

getColumnSum

public double getColumnSum(int iCol)
Returns the sum of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose sum is to be returned.
Returns:
Returns a double containing the sum of the values found in the specified column.

getColumnSum

public double getColumnSum(java.lang.String strColumnName)
Returns the sum of the values in the specified column.
Parameters:
strColumnName - The name of the column whose sum is to be returned.
Returns:
Returns a Double containing the sum of the values found in the specified column.

getColumnTitle

public java.lang.String getColumnTitle(int iCol)
Method to return the specified column's name
Parameters:
iCol - The column number (0-based index) whose title should be returned.
Returns:
String containing the specified column's title. If the column specified is invalid, then the String "Unknown" is returned.
See Also:
strUnknown

getColumnTitlesByColumn

public java.lang.String[] getColumnTitlesByColumn()
Method to return the titles of all this DataTable's columns in their numeric order (e.g., left (0) to right (m_iCols)).
Returns:
String[] containing all of the column's titles sorted in column number order.

getColumnTitlesByName

public java.lang.String[] getColumnTitlesByName()
Method to return the titles of all this DataTable's columns in their name order (e.g., alphabetic sort order).
Returns:
String[] containing all of the column's titles sorted in alphabetic sort order.

getColumnVariance

public double getColumnVariance(int iCol)
Returns the variance of the values in the specified column.
Parameters:
iCol - The column number (0-based index) whose variance is to be returned.
Returns:
Returns a double containing the variance of the values found in the specified column.

getColumnVariance

public double getColumnVariance(java.lang.String strColumnName)
Returns the variance of the values in the specified column.
Parameters:
strColumnName - The name of the column whose variance is to be returned.
Returns:
Returns a Double containing the variance of the values found in the specified column.

getDataSeries

public AbleDataSeries getDataSeries(int iCol)
Method to return the content of a named column as a DataSeries. This method is synchronized.
Parameters:
iCol - The column number (0-based index) whose contents are to be retrieved.
Returns:
A DataSeries corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned.

getDataSeries

public AbleDataSeries getDataSeries(java.lang.String strColumnName)
Method to return the content of a named column as a DataSeries. This method is synchronized.
Parameters:
strColumnName - The name of the column whose contents are to be retrieved.
Returns:
A DataSeries corresponding to the specified column. If the specified column is in error, an empty DataSeries is returned (unless it can't be constructed, in which case, a null is returned.

getDataTable

public AbleDataTable getDataTable(boolean bCalcOnAdd)
                           throws java.rmi.RemoteException
Method to create a new DataTable from the existing DataTable All aspects of this DataTable, including its name are retained in the new one with the exception of whether or not statistical calculations are to be performed when rows are added to the DataTable being returned.
Parameters:
bCalcOnAdd - allows the caller to specify if statistical calculations are to be performed when new rows are added to the DataTable being returned.
Returns:
Returns a DataTable identical to this one with its flag for statistical calculations set to the passed parameter value. If an unrecoverable error occurs, null is returned.

getDataTable

public AbleDataTable getDataTable(int iCol,
                                  java.lang.Object from,
                                  java.lang.Object thru,
                                  boolean bIsSorted)
                           throws java.rmi.RemoteException
Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column. If this DataTable's column is sorted, a binary search is used, otherwise, a brute force scan is used to locate conforming rows of data. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be searched for conforming values between the from and thru values passed.
from - An Object defining the lower bound for comparison
thru - An Object defining the upper bound for comparison
bIsSorted - A value defining whether (true) or not (false) the column being searched is sorted. If sorted, a binary search is used. Otherwise, a brute force scan of the entire column is used to find conforming values.
Returns:
An AbleDataTable is returned containing only the rows from this DataTable where the values in the specificed column fall within the range [from,thru]. If there is an error, an empty AbleDataTable (new AbleDataTable(0)) is returned unless it can't be constructed, then null is returned instead.

getDataTable

public AbleDataTable getDataTable(int[] indexArray)
                           throws java.rmi.RemoteException
Method to create a new DataTable from the existing DataTable based on a subset of row indices. All other aspects of this DataTable, including its name are retained in the new one.
Parameters:
iIndices - is an array of row indices (int[]) to be copied from this DataTable into the one being returned.
Returns:
Returns a DataTable identical to this one, except its contents are limited to the "rows" identified by the indices in the passed array. If an unrecoverable error occurs, null is returned.

getDataTable

public AbleDataTable getDataTable(int[] indexArray,
                                  boolean bCalcOnAdd)
                           throws java.rmi.RemoteException
Method to create a new DataTable from the existing DataTable based on a subset of row indices. All other aspects of this DataTable, including its name are retained in the new one with the exception of the flag determining if statistics are updated when values are added, based on the parameter passed.
Parameters:
iIndices - is an array of row indices (int[]) to be copied from this DataTable into the one being returned.
BCalcOnAdd - allows the caller to specify if statistical calculations are to be performed when new rows are added to the DataTable being returned.
Returns:
Returns a DataTable identical to this one, except its contents are limited to the "rows" identified by the indices in the passed array. If an unrecoverable error occurs, null is returned.

getDataTable

public AbleDataTable getDataTable(java.lang.Object indexArrayObj)
                           throws java.rmi.RemoteException
Method to create a new DataTable from the existing DataTable based on a subset of row indices passed in an object. All other aspects of this DataTable, including its name are retained in the new one.
Parameters:
iIndices - is an array of row indices (int[]) stored in an Object to be copied from this DataTable into the one being returned.
Returns:
Returns a DataTable identical to this one, except its contents are limited to the "rows" identified by the indices in the passed array. If an unrecoverable error occurs, null is returned.

getDataTable

public AbleDataTable getDataTable(java.lang.String strColumnName,
                                  java.lang.Double DFrom,
                                  java.lang.Double DThru,
                                  boolean bIsSorted)
                           throws java.rmi.RemoteException
Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column. If this DataTable's column is sorted, a binary search is used, otherwise, a brute force scan is used to locate conforming rows of data. This method uses the synchronized getDataTable(int,Object,Object,boolean) method.
Parameters:
strColumnName - The name of the column to be searched for conforming values between the from and thru values passed.
DFrom - A Double defining the lower bound for comparison
DThru - A Double defining the upper bound for comparison
bIsSorted - A value defining whether (true) or not (false) the column being searched is sorted. If sorted, a binary search is used. Otherwise, a brute force scan of the entire column is used to find conforming values.
Returns:
An AbleDataTable is returned containing only the rows from this DataTable where the values in the specificed column fall within the range [from,thru]. If there is an error, an empty AbleDataTable (new AbleDataTable(0)) is returned unless it can't be constructed, then null is returned instead.

getDataTable

public AbleDataTable getDataTable(java.lang.String strColumnName,
                                  java.lang.Object objFrom,
                                  java.lang.Object objThru,
                                  boolean bIsSorted)
                           throws java.rmi.RemoteException
Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column. If this DataTable's column is sorted, a binary search is used, otherwise, a brute force scan is used to locate conforming rows of data. This method uses the synchronized getDataTable(int,Object,Object,boolean) method.
Parameters:
strColumnName - The name of the column to be searched for conforming values between the from and thru values passed.
objFrom - An Object defining the lower bound for comparison
objThru - An Object defining the upper bound for comparison
bIsSorted - A value defining whether (true) or not (false) the column being searched is sorted. If sorted, a binary search is used. Otherwise, a brute force scan of the entire column is used to find conforming values.
Returns:
An AbleDataTable is returned containing only the rows from this DataTable where the values in the specificed column fall within the range [from,thru]. If there is an error, an empty AbleDataTable (new AbleDataTable(0)) is returned unless it can't be constructed, then null is returned instead.

getDataTable

public AbleDataTable getDataTable(java.lang.String strColumnName,
                                  java.lang.String strFrom,
                                  java.lang.String strThru,
                                  boolean bIsSorted)
                           throws java.rmi.RemoteException
Method to return a portion of this DataTable based on the selection criteria of the from and thru parameters for the specified column. If this DataTable's column is sorted, a binary search is used, otherwise, a brute force scan is used to locate conforming rows of data. This method uses the synchronized getDataTable(int,Object,Object,boolean) method.
Parameters:
strColumnName - The name of the column to be searched for conforming values between the from and thru values passed.
strFrom - A String defining the lower bound for comparison
strThru - A String defining the upper bound for comparison
bIsSorted - A value defining whether (true) or not (false) the column being searched is sorted. If sorted, a binary search is used. Otherwise, a brute force scan of the entire column is used to find conforming values.
Returns:
An AbleDataTable is returned containing only the rows from this DataTable where the values in the specificed column fall within the range [from,thru]. If there is an error, an empty AbleDataTable (new AbleDataTable(0)) is returned unless it can't be constructed, then null is returned instead.

getRow

public java.util.Vector getRow(int iRow)
Method to return the row specified by the supplied number. This method is synchronized.
Parameters:
iRow - The row number (0-based index) whose contents are to be returned as a Vector.
Returns:
A Vector of the Objects in the specified row of this DataTable. If the row selector is invalid, an empty vector (new Vector(0)) is returned.

getRowCount

public int getRowCount()
Method to return the number of rows in this DataTable.
Returns:
An int containing the number of rows in this DataTable.

getTypeClassesByColumn

public java.lang.Class[] getTypeClassesByColumn()
Method to return the Classes of all this DataTable's columns in their column numeric order (e.g., left (0) to right (m_iCols)).
Returns:
Class[] containing all of the column's Classes sorted in column number order.
See Also:
classDouble, classInteger, classString

getTypesByColumn

public java.lang.String[] getTypesByColumn()
Method to return the types (names of Classes) of all this DataTable's columns in their column numeric order (e.g., left (0) to right (m_iCols)).
Returns:
String[] containing all of the column's class types sorted in column number order.
See Also:
classDouble, classInteger, classString

isLocked

public boolean isLocked()
Method to return locked state of this object
See Also:
lock(), setLocked(boolean)

loadFromFile

public AbleDataTable loadFromFile(java.lang.String strFileName)
Utility method to create and fill a new DataTable with the contents of a specified file.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
Returns:
AbleDataTable with contents from file, or null.

loadFromFile

public AbleDataTable loadFromFile(java.lang.String strFileName,
                                  boolean bHasTitles,
                                  boolean bCalcOnAdd)
Utility method to create and fill a new DataTable with the contents of a specified file.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
bHasTitles - specifies whether (true) or not (false) the file being read contains column titles in its first row.
bCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.
Returns:
AbleDataTable with contents from file, or null.

loadFromFile

public AbleDataTable loadFromFile(java.lang.String strFileName,
                                  java.lang.Boolean BHasTitles,
                                  java.lang.Boolean BCalcOnAdd)
Utility method to create and fill a new DataTable with the contents of a specified file.
Parameters:
strFileName - the name of the file (may include path information) that will be read to fill this DataTable.
BHasTitles - specifies whether (true) or not (false) the file being read contains column titles in its first row.
BCalcOnAdd - specifies whether (true) or not (false) statistical calculations should be performed when rows are added to this DataTable.
Returns:
AbleDataTable with contents from file, or null.

lock

public void lock()

replaceColArray

protected boolean replaceColArray(AbleDataSeries[] colArray)
Method to replace the current content of this DataTable with another set of columns. This method is synchronized.
Parameters:
colArray - An array of AbleDataSeries that will be used to replace the content of this DataTable.
Returns:
A boolean describing the success (true) or failure (false) of this method.

saveToFile

public boolean saveToFile(java.lang.String strFileName,
                          java.lang.String strDelimiter)
Method to save the content of this DataTable to a delimited text file, including the column titles in the first record written. The resulting file can later be used to construct a new DataTable. This method will overwrite an existing file if it exists. This method calls the synchronized saveToFile(String, String, Boolean) method.
Parameters:
strFileName - The String containing the name (and optionally the path) of the file to receive the content of this DataTable.
strDelimiter - The String containing the character(s) to be used to delimit the fields in the records written to the output file.
Returns:
A boolean value determining if this call succeeded (true) or failed (false).

saveToFile

public boolean saveToFile(java.lang.String strFileName,
                          java.lang.String strDelimiter,
                          boolean bOverwrite)
Method to save the content of this DataTable to a delimited text file, including the column titles in the first record written. The resulting file can later be used to construct a new DataTable. This method will overwrite an existing file if it exists. This method is synchronized.
Parameters:
strFileName - The String containing the name (and optionally the path) of the file to receive the content of this DataTable.
strDelimiter - The String containing the character(s) to be used to delimit the fields in the records written to the output file.
bOverwrite - A boolean to determine whether (true) or not (false) the file specified should be overwritten if it exists. If false is specified and the file exists, nothing happens and the method returns false.
Returns:
A Boolean value determining if this call succeeded (true) or failed (false).

setCalcOnAdd

public void setCalcOnAdd(boolean bCalcOnAdd)
Allows one to control the value of the m_bCalcOnAdd flag describing whether (true) or not (false) statistical calculations are performed when values are added to the history maintained by this object. This method is synchronized.
Parameters:
bCalcOnAdd - defines whether (true) or not (false) statistical calculations are performed when values are added to the history maintained by this object.

setCapacity

public void setCapacity(int iCapacity)
Method to alter the size of the history maintained by this object. At present, the size can only be increased (e.g., made larger than the current history size). If a size is passed that is not greater than the current history size, no changes are made.
Parameters:
iCapacity - The desired size of the history maintained by this object.

setCell

public boolean setCell(int iRow,
                       int iCol,
                       java.lang.Object objInput)
Method to set the specified "cell" in this DataTable to the value in the object passed. This method is synchronized.
Parameters:
iRow - The row number (0-based index) for the "cell" to be changed.
iCol - The column number (0-based index) for the "cell" to be changed.
objInput - The Object containing the value to be placed in the "cell" specified at the address (iCol, iRow) in this DataTable.
Returns:
A boolean specifying the success (true) or failure (false) of this method.

setColumn

public boolean setColumn(int iCol,
                         AbleDataSeries colSeries)
Method to set the specified column's data values to those in the supplied DataSeries. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be updated.
colSeries - A DataSeries containing the Objects to be used to update the current content of the specified column's history.
Returns:
boolean declaring success (true) or failure (false).

setColumn

public boolean setColumn(int iCol,
                         java.lang.Object[] colData)
Method to set the specified column's data values to those in the supplied Object[].
Parameters:
iCol - The column number (0-based index) to be updated.
colData - An Object[] containing the Objects to be used to update the current content of the specified column's history. This method is synchronized.
Returns:
boolean declaring success (true) or failure (false).

setColumn

public boolean setColumn(int iCol,
                         java.util.Vector colData)
Method to set the specified column's data values to those in the supplied Vector. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be updated.
colData - A Vector containing the Objects to be used to update the current content of the specified column's history.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(int iCol,
                                        int[] selectRows,
                                        java.lang.Object colData)
Method to set the specified column's data values to the supplied value. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be updated.
selectRows - The int[] containing the indices of the rows to be updated with the supplied value.
colData - An Object containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(java.lang.String strColumnName,
                                        java.lang.Object selectRows,
                                        java.lang.Double colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnSelectedToValue(int,int[],Object) method.
Parameters:
strColumnName - The name of the column to be updated.
selectRows - An Object holding an int[] containing the indices of the rows to be updated with the supplied value.
colData - A Double containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(java.lang.String strColumnName,
                                        int[] selectRows,
                                        java.lang.Double colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnSelectedToValue(int,int[],Object) method.
Parameters:
strColumnName - The name of the column to be updated.
selectRows - The int[] containing the indices of the rows to be updated with the supplied value.
colData - A Double containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(java.lang.String strColumnName,
                                        int[] selectRows,
                                        java.lang.Integer colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnSelectedToValue(int,int[],Object) method.
Parameters:
strColumnName - The name of the column to be updated.
selectRows - The int[] containing the indices of the rows to be updated with the supplied value.
colData - An Integer containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(java.lang.String strColumnName,
                                        int[] selectRows,
                                        java.lang.Object colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnSelectedToValue(int,int[],Object) method.
Parameters:
strColumnName - The name of the column to be updated.
selectRows - The int[] containing the indices of the rows to be updated with the supplied value.
colData - An Object containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnSelectedToValue

public boolean setColumnSelectedToValue(java.lang.String strColumnName,
                                        int[] selectRows,
                                        java.lang.String colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnSelectedToValue(int,int[],Object) method.
Parameters:
strColumnName - The name of the column to be updated.
selectRows - The int[] containing the indices of the rows to be updated with the supplied value.
colData - A String containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnTitle

public void setColumnTitle(int iCol,
                           java.lang.String strTitle)
Method to set a specified columns title to the specified String
Parameters:
iCol - The column number (0-based index) whose name should be changed to the passed String. This method is synchronized as it updates both the underlying DataSeries and the Hashtable.
strTitle - The new name for the specified column.

setColumnTitle

public void setColumnTitle(java.lang.String strColumnName,
                           java.lang.String strTitle)
Method to set a specified columns title to the specified String
Parameters:
strColumnName - The name of the column whose name should be changed to the passed String. This method is synchronized as it updates both the underlying DataSeries and the Hashtable.
strTitle - The new name for the specified column.

setColumnTitles

public void setColumnTitles(java.lang.String[] titleList)
Method to revise the current titles for the DataTable's columns using the content of the passed String[].
Parameters:
titleList - The String[] containing the new Strings to be used as column heading in this DataTable.

setColumnTitles

public void setColumnTitles(java.util.Vector titleList)
Method to revise the current titles for the DataTable's columns using the content of the passed Vector.
Parameters:
titleList - The Vector containing the new Strings to be used as column heading in this DataTable.

setColumnToValue

public boolean setColumnToValue(int iCol,
                                java.lang.Object colData)
Method to set the specified column's data values to the supplied value. This method is synchronized.
Parameters:
iCol - The column number (0-based index) to be updated.
colData - A Double containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnToValue

public boolean setColumnToValue(java.lang.String strColumnName,
                                java.lang.Double colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnToValue(int,Object) method.
Parameters:
strColumnName - The name of the column to be updated.
colData - A Double containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnToValue

public boolean setColumnToValue(java.lang.String strColumnName,
                                java.lang.Integer colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnToValue(int,Object) method.
Parameters:
strColumnName - The name of the column to be updated.
colData - An Integer containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnToValue

public boolean setColumnToValue(java.lang.String strColumnName,
                                java.lang.Object colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnToValue(int,Object) method.
Parameters:
strColumnName - The name of the column to be updated.
colData - An Object containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setColumnToValue

public boolean setColumnToValue(java.lang.String strColumnName,
                                java.lang.String colData)
Method to set the specified column's data values to the supplied value. This method uses the synchronized setColumnToValue(int,Object) method.
Parameters:
strColumnName - The name of the column to be updated.
colData - A String containing the value to be used to initialize all the values of this column.
Returns:
boolean declaring success (true) or failure (false).

setLocked

public void setLocked(boolean bLocked)
Method to set locked state of this object. When locked, values can only be added until the Capacity is reached, then the history will begin being overwritten.
Parameters:
bLocked - boolean describing the desired lock state for history. When locked, this object will wrap and overwrite values in its history, rather than growing larger to accommodate new entries.

setRow

public boolean setRow(java.lang.Double DRow,
                      java.util.Vector rowData)
Method to update a rows contents with the data passed in the Vector.
Parameters:
DRow - is the row number (0-based index) to be updated.
rowData - is the Vector containing the Objects corresponding to the values to be set in each of the row's columns.
Returns:
boolean to signify success (true) or failure (false).

setRow

public boolean setRow(int iRow,
                      java.util.Vector rowData)
Method to update a rows contents with the data passed in the Vector.
Parameters:
iRow - is the row number (0-based index) to be updated.
rowData - is the Vector containing the Objects corresponding to the values to be set in each of the row's columns.
Returns:
boolean to signify success (true) or failure (false).

setRow

public boolean setRow(int iRow,
                      java.lang.Object[] rowData)
Method to update a rows contents with the data passed in the Object[].
Parameters:
iRow - is the row number (0-based index) to be updated.
rowData - is the Object[] containing the Objects corresponding to the values to be set in each of the row's columns.
Returns:
boolean to signify success (true) or failure (false).

setTypeClasses

public boolean setTypeClasses(java.lang.Class[] classTypes)
Method to alter the column storage method (and potentially, their contents) to match the specified Class. This method is synchronized.
Parameters:
classTypes - An array of Classes comprising classInteger, classDouble, or classString used to determine the resulting storage strategy to be used for each corresponding column.
Returns:
boolean to determine if the call was successful (true) or if an error occurred (false).
See Also:
classDouble, classInteger, classString

unlock

public void unlock()
Method to unlock this DataTable to allow history expansion when new values are added.

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

(C) Copyright IBM Corporation 1999, 2003