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

com.ibm.able.beans
Class AbleDataSeries

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

public class AbleDataSeries
extends AbleObject
implements java.io.Serializable

Class to maintain a growing or circular history for a particular metric value, and to provide various statistics about the values currently maintained in this history. This class can hold either Integers, Doubles, or Strings which are maintained internally as int[], double[], or String[] respectively. If you started holding Integers, and later asked it to hold a Double, all previous history will be converted to doubles and the internal array will automatically be updated from int[] to double[]. Likewise, if you attemped to add a String to a history originally specififed to hold Integers or Doubles, the history will be automatically converted to String[] with the numeric values being added as their String equivalents. You can not currently convert backward from a Double to an Integer. 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:
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 or Double).
static java.lang.Class classDouble
          Class used to signify the content of the array is being maintained internally as a double[].
static java.lang.Class classDoubleArray
          Class used to signify the content of the array is being maintained internally as a double[].
static java.lang.Class classIntArray
          Class used to signify the content of the array is being maintained internally as an int[].
static java.lang.Class classInteger
          Class used to signify the content of the array is being maintained internally as an int[].
static java.lang.Class classString
          Class used to signify the content of the array is being maintained internally as a String[].
static java.lang.Class classStringArray
          Class used to signify the content of the array is being maintained internally as a String[].
static boolean DEFAULT_CALC_ON_ADD
          Default value for whether (true) or not (false) calculations should be performed each time a value is added to the history of this DataSeries.
static int DEFAULT_GROWTH_INCREMENT
          The default growth increment used to increase capacity of unlocked DataSeries.
static boolean DEFAULT_HAS_TITLES
          Default value for whether (true) or not (false) files are expected to contain the DataSeries name headers as the first entry (record).
static int DEFAULT_HISTORY_SIZE
          The default capacity of the history maintained is set to this value unless a capacity is specified 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, when none is available or when an error has occurred.
static java.lang.String strUnknown
          The default for unnamed DataSeries == "Unknown".
 
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
AbleDataSeries()
          Void constructor to create an object with default size, unknown type (will be updated with the first addition to the history), and will calculate statistics on additions of data to the history.
AbleDataSeries(boolean bCalcOnAdd)
          Constructor allowing an object to be created using the default history size, deferring the type of data until the first addition to the history, and allowing selection whether or not statistical calculations are performed when data is added.
AbleDataSeries(java.lang.Double[] DArray)
          Constructor allowing an object to be created using an array of Doubles containing the initial objects to be added to the history, and whose size is used to determine the history size.
AbleDataSeries(java.lang.Double[] DArray, boolean bCalcOnAdd)
          Constructor allowing an object to be created using an array of Doubles containing the initial objects to be added to the history, and whose size is used to determine the history size.
AbleDataSeries(int iCapacity)
          Constructor allowing objects to be constructed with the specified history size.
AbleDataSeries(int iCapacity, boolean bCalcOnAdd)
          Constructor allowing an object to be created with specified int history size and boolean flag whether or not statistical calculations should be performed when data is added.
AbleDataSeries(java.lang.Integer[] IArray)
          Constructor allowing an object to be created using an array of Integers containing the initial objects to be added to the history, and whose size is used to determine the history size.
AbleDataSeries(java.lang.Integer[] IArray, boolean bCalcOnAdd)
          Constructor allowing an object to be created using an array of Integers containing the initial objects to be added to the history, and whose size is used to determine the history size.
AbleDataSeries(int iCapacity, java.lang.Object objArrayType)
          Constructor allowing an object to be created using the specified size for its history, the specified objArrayType to determine the type of data to be stored as well as providing the first value to be added to the history.
AbleDataSeries(int iCapacity, java.lang.Object objArrayType, boolean bCalcOnAdd)
          Constructor allowing an object to be created using the specified size for its history, the specified objArrayType to determine the type of data to be stored as well as providing the first value to be added to the history, and a flag whether or not statistical calculations should be performed when values are added to the history.
AbleDataSeries(java.util.Vector vectContent)
          Constructor allowing an object to be created using a Vector containing the initial objects to be added to the history, and whose size is used to determine the history size.
AbleDataSeries(java.util.Vector vectContent, boolean bCalcOnAdd)
          Constructor allowing an object to be created using a List (Vector) containing the initial objects to be added to the history, and whose size is used to determine the history size.
 
Method Summary
 boolean absDataSeries()
          absDataSeries takes the absolute value of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean acosDataSeries()
          acosDataSeries takes the arc cosine of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean addDataSeries(AbleDataSeries dsAdd)
          addDataSeries adds each of the values in this DataSeries by their corresponding value in the passed DataSeries.
 void addValue(double dValue)
          Adds the passed value to the "beginning" of the circular history being maintained by this object.
 void addValue(java.lang.Double DValue)
          Method to add a value to the history being maintained by this object.
 void addValue(int iValue)
          Adds the passed value to the "beginning" of the history being maintained by this object.
 void addValue(java.lang.Integer IValue)
          Adds an Integer value to the "beginning" of the history being maintained by this object.
 void addValue(java.lang.Object objValue)
          Generic method to add the object passed to the "beginning" of the history being maintained by this object.
 void addValue(java.lang.String strValue)
          Adds the passed value to the "beginning" of the history being maintained by this object.
 java.lang.Double append(AbleDataSeries appendSeries)
          Append the contents of one DataSeries to the front of this DataSeries history (e.g., as newer data).
 boolean asinDataSeries()
          asinDataSeries takes the arc sine of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean atanDataSeries()
          atanDataSeries takes the arc tangent of each of the values in this DataSeries, storing the result in this DataSeries.
 void clear()
          Clears the contents of the history maintained by this object.
 java.lang.String contentsAsString()
          Method that returns the contents of the history maintained by this object as a String of comma separated values.
 java.lang.String contentsAsString(int iBreakCount)
          Method that returns the contents of the history maintained by this object as a String of comma separated values.
static java.lang.String Copyright()
          Provides the copyright of this class.
 boolean cosDataSeries()
          cosDataSeries takes the cosine of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean deltaDataSeries()
          deltaDataSeries calculates the difference between the current value (ith) in this DataSeries and the next (i+1th), storing the result in this DataSeries.
 boolean divideDataSeries(AbleDataSeries dsDivisor)
          divideDataSeries divides each of the values in this DataSeries by their corresponding value in the passed DataSeries.
 boolean divideDataSeries(double dDivisor)
          divideDataSeries divides the value passed to each of the values in this DataSeries.
 boolean divideDataSeries(int iDivisor)
          divideDataSeries adds the value passed to each of the values in this DataSeries.
 boolean divideDataSeries(java.lang.Object objDivisor)
          divideDataSeries divides the value passed to each of the values in this DataSeries.
 boolean expDataSeries()
          expDataSeries takes the exponentiation (Euler's number e raised to the power of X) of each of the values in this DataSeries, storing the result in this DataSeries.
 double getAverage()
          Returns the average of the values in the history being maintained by this object.
 boolean getCalcOnAdd()
          Returns the boolean value of the m_bCalcOnAdd flag.
 int getCapacity()
          Return the potential capacity for entries in this DataSeries history as an int.
 int getCount()
          Return the number of entries in this DataSeries history as an int.
 java.lang.Object getDataArray()
          Get the history maintained by this DataSeries ordered from oldest to newest entry.
 AbleDataSeries getDataSeries()
          Method to create a new DataSeries from the existing DataSeries All aspects of this DataSeries, including its name are retained in the new one.
 AbleDataSeries getDataSeries(int[] iIndices)
          Method to create a new DataSeries from the existing DataSeries based on a subset of indices.
 int getGrowthIncrement()
          Method to get the growth increment of this DataSeries history.
 double getMaximum()
          Returns the maximum value found in the history being maintained by this object.
 int getMaximumAsInt()
          Returns the maximum value found in the history being maintained by this object.
 double getMinimum()
          Returns the minimum value in the history being maintained by this object.
 int getMinimumAsInt()
          Returns the minimum value in the history maintained by this object as an int
 java.lang.Class getSeriesClass()
          Return the Class describing the class of the history (array) being used to store the data values in this DataSeries.
 java.lang.Class getSeriesValueClass()
          Return the Class describing the data stored in this DataSeries.
 double getStdDeviation()
          Returns the standard deviation of the values in the history being maintained by this object.
 double getSum()
          Returns the sum of the values in the history being maintained by this object.
 int getSumAsInt()
          Returns the sum of the values in the history being maintained by this object as an int.
 double getSumSquared()
          Returns the sum of the squares of the values in the history being maintained by this object.
 int getSumSquaredAsInt()
          Returns the sum of the squares of the values in the history being maintained by this object as an int.
 java.lang.Object getValue(double dIndex)
          Returns the Object located at the specified location in its history.
 java.lang.Object getValue(int iIndex)
          Returns the Object located at the specified location in its history.
 java.lang.Double getValueAsDouble(double dIndex)
          Returns the Object located at the specified location in its history as a Double.
 java.lang.Double getValueAsDouble(int iIndex)
          Returns the Object located at the specified location in its history as a Double.
 double getVariance()
          Returns the variance of the values in the history being maintained by this object.
 double getVarianceOldWay()
          Returns the variance of the values in the history being maintained by this object.
 int increaseCapacity(int iIncrement)
          Method to increase the size of history maintained by this object by the incremental amount passed.
 boolean incrementDataSeries(double dIncrement)
          incrementDataSeries adds the value passed to each of the values in this DataSeries.
 boolean incrementDataSeries(int iIncrement)
          incrementDataSeries adds the value passed to each of the values in this DataSeries.
 boolean incrementDataSeries(java.lang.Object objIncrement)
          incrementDataSeries adds the value passed to each of the values in this DataSeries.
 boolean isLocked()
          Method to return locked state of this object
 void lock()
          Method to lock this DataSeries to force wrapping when new values are added, once the DataSeries' capacity has been reached.
 boolean log10DataSeries()
          log10DataSeries takes the log (base 10) of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean logDataSeries()
          logDataSeries takes the natural log (base e) of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean multiplyDataSeries(AbleDataSeries dsMultiply)
          multiplyDataSeries multiplies each of the values in this DataSeries by their corresponding value in the passed DataSeries.
 boolean multiplyDataSeries(double dMulitiplier)
          multiplyDataSeries multiplies the value passed to each of the values in this DataSeries.
 boolean multiplyDataSeries(int iMulitiplier)
          multiplyDataSeries adds the value passed to each of the values in this DataSeries.
 boolean multiplyDataSeries(java.lang.Object objMulitiplier)
          multiplyDataSeries multiplies the value passed to each of the values in this DataSeries.
 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.
 int setCapacity(int iCapacity)
          Method to alter the size of the history maintained by this object.
 boolean setDataSeries(java.lang.Object valueArray)
          setDataSeries resets the history to values supplied in the passed valueArray.
 void setGrowthIncrement(int iGrowthIncrement)
          Method to set the growth increment for this DataSeries history.
 void setLocked(boolean bLocked)
          Method to set locked state of this object.
 void setSeriesValueClass(java.lang.Class classType)
          Method to change the kind of values being stored in the history of this DataSeries.
 boolean setValue(int iIndex, java.lang.Object objValue)
          Generic method to set the object passed to the ith value of the history being maintained by this object.
 boolean sinDataSeries()
          sinDataSeries takes the sine of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean squareDataSeries()
          squareDataSeries multiplies each of the values in this DataSeries by themselves storing the result in this DataSeries.
 boolean squarerootDataSeries()
          squarerootDataSeries takes the square root of each of the values in this DataSeries, storing the result in this DataSeries.
 boolean subtractDataSeries(AbleDataSeries dsSubtract)
          subtractDataSeries subtracts each of the values in this DataSeries by their corresponding value in the passed DataSeries.
 boolean tanDataSeries()
          tanDataSeries takes the tangent of each of the values in this DataSeries, storing the result in this DataSeries.
 void unlock()
          Method to unlock this DataSeries 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 or Double). No history will be maintained for anything except Integers or Doubles.

classDouble

public static final java.lang.Class classDouble
Class used to signify the content of the array is being maintained internally as a double[]. When objects are passed into 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 content of the array is being maintained internally as a double[]. When ann array object is passed into this class, their Java Class is compared against this value to see if conversion is necessary. Eventual type for this will be classDouble.
See Also:
classDouble

classIntArray

public static final java.lang.Class classIntArray
Class used to signify the content of the array is being maintained internally as an int[]. When an array object is passed into this class, their Java Class is compared against this value to see if conversion is necessary. Eventual type for this will be classInteger.
See Also:
classInteger

classInteger

public static final java.lang.Class classInteger
Class used to signify the content of the array is being maintained internally as an int[]. When objects are passed into 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 content of the array is being maintained internally as a String[]. When objects are passed into 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 content of the array is being maintained internally as a String[]. When an array object is passed into this class, their Java Class is compared against this value to see if conversion is necessary. Eventual type for this will be classString.
See Also:
classString

DEFAULT_CALC_ON_ADD

public static final boolean DEFAULT_CALC_ON_ADD
Default value for whether (true) or not (false) calculations should be performed each time a value is added to the history of this DataSeries. This value is a boolean set to false for better performance.

DEFAULT_GROWTH_INCREMENT

public static final int DEFAULT_GROWTH_INCREMENT
The default growth increment used to increase capacity of unlocked DataSeries.

DEFAULT_HAS_TITLES

public static final boolean DEFAULT_HAS_TITLES
Default value for whether (true) or not (false) files are expected to contain the DataSeries name headers as the first entry (record). This value is a boolean set to true.

DEFAULT_HISTORY_SIZE

public static final int DEFAULT_HISTORY_SIZE
The default capacity of the history maintained is set to this value unless a capacity is specified 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, when none is available or when an error has occurred.

strUnknown

public static final java.lang.String strUnknown
The default for unnamed DataSeries == "Unknown".
Constructor Detail

AbleDataSeries

public AbleDataSeries()
Void constructor to create an object with default size, unknown type (will be updated with the first addition to the history), and will calculate statistics on additions of data to the history.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(boolean bCalcOnAdd)
Constructor allowing an object to be created using the default history size, deferring the type of data until the first addition to the history, and allowing selection whether or not statistical calculations are performed when data is added.
Parameters:
bCalcOnAdd - boolean flag determining whether (true) or not (false) statistical calculations should be kept up to date when data is added to the history.

AbleDataSeries

public AbleDataSeries(int iCapacity)
Constructor allowing objects to be constructed with the specified history size.
Parameters:
iCapacity - The size of the circular buffer (array) used to maintain history.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(int iCapacity,
                      boolean bCalcOnAdd)
Constructor allowing an object to be created with specified int history size and boolean flag whether or not statistical calculations should be performed when data is added.
Parameters:
iCapacity - The size of the circular buffer (array) used to maintain history.
bCalcOnAdd - A flag to determine whether (true) or not (false) statistical calculation should be performed when data is added to the history.

AbleDataSeries

public AbleDataSeries(int iCapacity,
                      java.lang.Object objArrayType)
Constructor allowing an object to be created using the specified size for its history, the specified objArrayType to determine the type of data to be stored as well as providing the first value to be added to the history. Statistical calculations will be performed each time a value is added to the history.
Parameters:
iCapacity - The size of the circular buffer (array) used to maintain history.
objArrayType - An initial seed object used to identify the type of data to be stored (Integer or Double). This object is added to the history as its first value.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(int iCapacity,
                      java.lang.Object objArrayType,
                      boolean bCalcOnAdd)
Constructor allowing an object to be created using the specified size for its history, the specified objArrayType to determine the type of data to be stored as well as providing the first value to be added to the history, and a flag whether or not statistical calculations should be performed when values are added to the history.
Parameters:
iCapacity - The size of the circular buffer (array) used to maintain history.
objArrayType - An initial seed object used to identify the type of data to be stored (Integer or Double). This object is added to the history as its first value.
bCalcOnAdd - Flag to determine whether (true) or not (false) statistical calculation should be performed when data is added to the history.

AbleDataSeries

public AbleDataSeries(java.util.Vector vectContent)
Constructor allowing an object to be created using a Vector containing the initial objects to be added to the history, and whose size is used to determine the history size. Statistical calculations will be performed each time a value is added to the history.
Parameters:
vectContent - The List (Vector) containing the seed elements for the initial history.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(java.util.Vector vectContent,
                      boolean bCalcOnAdd)
Constructor allowing an object to be created using a List (Vector) containing the initial objects to be added to the history, and whose size is used to determine the history size. A flag is also specified whether or not statistical calculations should be performed when values are added to the history.
Parameters:
vectContent - The List (Vector) containing the seed elements for the initial history.
bCalcOnAdd - Flag to determine whether (true) or not (false) statistical calculation should be performed when data is added to the history.

AbleDataSeries

public AbleDataSeries(java.lang.Double[] DArray)
Constructor allowing an object to be created using an array of Doubles containing the initial objects to be added to the history, and whose size is used to determine the history size. A flag is also specified whether or not statistical calculations should be performed when values are added to the history.
Parameters:
DArray - The array of Doubles containing the seed elements for the initial history.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(java.lang.Double[] DArray,
                      boolean bCalcOnAdd)
Constructor allowing an object to be created using an array of Doubles containing the initial objects to be added to the history, and whose size is used to determine the history size. A flag is also specified whether or not statistical calculations should be performed when values are added to the history.
Parameters:
DArray - The array of Doubles containing the seed elements for the initial history.
bCalcOnAdd - Flag to determine whether (true) or not (false) statistical calculation should be performed when data is added to the history.

AbleDataSeries

public AbleDataSeries(java.lang.Integer[] IArray)
Constructor allowing an object to be created using an array of Integers containing the initial objects to be added to the history, and whose size is used to determine the history size. A flag is also specified whether or not statistical calculations should be performed when values are added to the history.
Parameters:
IArray - The array of Integers containing the seed elements for the initial history.
See Also:
DEFAULT_CALC_ON_ADD

AbleDataSeries

public AbleDataSeries(java.lang.Integer[] IArray,
                      boolean bCalcOnAdd)
Constructor allowing an object to be created using an array of Integers containing the initial objects to be added to the history, and whose size is used to determine the history size. A flag is also specified whether or not statistical calculations should be performed when values are added to the history.
Parameters:
IArray - The array of Integers containing the seed elements for the initial history.
bCalcOnAdd - Flag to determine whether (true) or not (false) statistical calculation should be performed when data is added to the history.
Method Detail

Copyright

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

absDataSeries

public boolean absDataSeries()
absDataSeries takes the absolute value of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

acosDataSeries

public boolean acosDataSeries()
acosDataSeries takes the arc cosine of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

addDataSeries

public boolean addDataSeries(AbleDataSeries dsAdd)
addDataSeries adds each of the values in this DataSeries by their corresponding value in the passed DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
dsAdd - an AbleDataSeries containing values to be added to this DataSeries values. The passed DataSeries must be the same length as this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

addValue

public void addValue(double dValue)
Adds the passed value to the "beginning" of the circular history being maintained by this object.
Parameters:
dValue - The value to be added to the history.

addValue

public void addValue(java.lang.Double DValue)
Method to add a value to the history being maintained by this object. The value is added to the "beginning" of the circular history buffer.
Parameters:
DValue - The value to be added to the history of this object.

addValue

public void addValue(int iValue)
Adds the passed value to the "beginning" of the history being maintained by this object.
Parameters:
iValue - The value to be added to the history of this object.

addValue

public void addValue(java.lang.Integer IValue)
Adds an Integer value to the "beginning" of the history being maintained by this object.
Parameters:
IValue - The value to be added to the history of this object.

addValue

public void addValue(java.lang.Object objValue)
Generic method to add the object passed to the "beginning" of the history being maintained by this object.
Parameters:
objValue - The object (Integer or Double) to be added to the history.

addValue

public void addValue(java.lang.String strValue)
Adds the passed value to the "beginning" of the history being maintained by this object.
Parameters:
strValue - The value to be added to the history of this object.

append

public java.lang.Double append(AbleDataSeries appendSeries)
Append the contents of one DataSeries to the front of this DataSeries history (e.g., as newer data). This method is synchronized. Returns the number of values appended as a Double.
Parameters:
appendSeries - is a DataSeries whose contents will be appended (added to) the front of the history maintained by this DataSeries. Note the DataSeries much contain the same type of data.
Returns:
The count of data values appended as a Double. Note, if the value returned is not equal to the getCount() of the DataSeries passed, an error occurred.

asinDataSeries

public boolean asinDataSeries()
asinDataSeries takes the arc sine of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

atanDataSeries

public boolean atanDataSeries()
atanDataSeries takes the arc tangent of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

clear

public void clear()
Clears the contents of the history maintained by this object. The history capacity is retained, but the type of data stored will be determined by the first value added to the history. The flag determining whether or not statistical calculations are to be performed when data is added is also retained, as is the flag whether or not to display errors.

contentsAsString

public java.lang.String contentsAsString()
Method that returns the contents of the history maintained by this object as a String of comma separated values.
Returns:
Returns the contents of the history maintained by this object as a String of comma separated values.

contentsAsString

public java.lang.String contentsAsString(int iBreakCount)
Method that returns the contents of the history maintained by this object as a String of comma separated values.
Parameters:
iBreakCount - inserts a newline after this number of entries has been added to the output String.
Returns:
Returns the contents of the history maintained by this object as a String of comma separated values.

cosDataSeries

public boolean cosDataSeries()
cosDataSeries takes the cosine of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

deltaDataSeries

public boolean deltaDataSeries()
deltaDataSeries calculates the difference between the current value (ith) in this DataSeries and the next (i+1th), storing the result in this DataSeries. Note: because there are n-1 deltas for n elements, the last element's delta will be zero (0). So, if the array contained these values: 1,5,7,8 then the resulting values would be 4,2,1,0 because 1+4=5, 2+5=7, 7+1=8, and 8 was the last element so it has no delta.
Returns:
boolean showing the method worked (true) or failed (false)

divideDataSeries

public boolean divideDataSeries(AbleDataSeries dsDivisor)
divideDataSeries divides each of the values in this DataSeries by their corresponding value in the passed DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
dsDivisor - an AbleDataSeries containing values to be used as divisors to be applied to this DataSeries values. The passed DataSeries must be the same length as this DataSeries. If a divisor is zero, no change will occur to the corresponding data in this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

divideDataSeries

public boolean divideDataSeries(double dDivisor)
divideDataSeries divides the value passed to each of the values in this DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
dDivisor - a double containing a positive or negative increment that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

divideDataSeries

public boolean divideDataSeries(int iDivisor)
divideDataSeries adds the value passed to each of the values in this DataSeries. Note: the increment value may be positive or negative.
Parameters:
iDivisor - an integer containing a positive or negative increment that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

divideDataSeries

public boolean divideDataSeries(java.lang.Object objDivisor)
divideDataSeries divides the value passed to each of the values in this DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
objDivisor - an Object containing an Integer or Double that will be divided into each value in this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

expDataSeries

public boolean expDataSeries()
expDataSeries takes the exponentiation (Euler's number e raised to the power of X) of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

getAverage

public double getAverage()
Returns the average of the values in the history being maintained by this object.
Returns:
Returns a double containing the average of the values found in the history of this object.

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 capacity for entries in this DataSeries history as an int.
Returns:
int containing the maximium storage allowed in the history before capacity is increased, or until data wraps on itself if the DataSeries is locked.

getCount

public int getCount()
Return the number of entries in this DataSeries history as an int.
Returns:
int containing the number of entries in the history.

getDataArray

public java.lang.Object getDataArray()
Get the history maintained by this DataSeries ordered from oldest to newest entry.
Returns:
Object containing a copy of the content of the history being maintained by this object in order from oldest to newest object as an array of the data native type (e.g., int[], double[], or String[]). Call getClass() on the returned object and compare it against classIntArray, classDoubleArray, or classStringArray if you need to know what you were returned.
See Also:
classIntArray, classDoubleArray, classStringArray

getDataSeries

public AbleDataSeries getDataSeries()
Method to create a new DataSeries from the existing DataSeries All aspects of this DataSeries, including its name are retained in the new one.
Returns:
Returns a DataSeries identical to this one. If an unrecoverable error occurs, null is returned.

getDataSeries

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

getGrowthIncrement

public int getGrowthIncrement()
Method to get the growth increment of this DataSeries history.

getMaximum

public double getMaximum()
Returns the maximum value found in the history being maintained by this object.
Returns:
Returns double value of the maximum value found in the history being maintained by this object.

getMaximumAsInt

public int getMaximumAsInt()
Returns the maximum value found in the history being maintained by this object.
Returns:
Returns the int value of the maximum value found in the history being maintained by this object as an int.

getMinimum

public double getMinimum()
Returns the minimum value in the history being maintained by this object.
Returns:
double containing the minimum value found in the history maintained by this object.

getMinimumAsInt

public int getMinimumAsInt()
Returns the minimum value in the history maintained by this object as an int
Returns:
Returns the minimum value in the history maintained by this object as an int.

getSeriesClass

public java.lang.Class getSeriesClass()
Return the Class describing the class of the history (array) being used to store the data values in this DataSeries. Note that internally the data are stored as int[], double[], or String[].
Returns:
Class that will match one of the following: classIntArray, classDoubleArray, or classStringArray
See Also:
classIntArray, classDoubleArray, classStringArray

getSeriesValueClass

public java.lang.Class getSeriesValueClass()
Return the Class describing the data stored in this 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[].
Returns:
Class that will match one of the following: classInteger, classDouble, or classString for comparison purposes.
See Also:
classInteger, classDouble, classString

getStdDeviation

public double getStdDeviation()
Returns the standard deviation of the values in the history being maintained by this object.
Returns:
Returns a Double containing the standard deviation of the values found in the history of this object.

getSum

public double getSum()
Returns the sum of the values in the history being maintained by this object.
Returns:
Returns a double containing the sum of the values found in the history of this object.

getSumAsInt

public int getSumAsInt()
Returns the sum of the values in the history being maintained by this object as an int.
Returns:
Returns the int value containing the sum of the values found in the history of this object as an int.

getSumSquared

public double getSumSquared()
Returns the sum of the squares of the values in the history being maintained by this object.
Returns:
Returns a double containing the sum of the squares of the values found in the history of this object.

getSumSquaredAsInt

public int getSumSquaredAsInt()
Returns the sum of the squares of the values in the history being maintained by this object as an int.
Returns:
Returns the int value containing the sum of the squares of the values found in the history of this object.

getValue

public java.lang.Object getValue(double dIndex)
Returns the Object located at the specified location in its history.
Parameters:
dIndex - The index of the value to be returned from the history being maintained by this object. If the index passed is invalid this method returns null.
Returns:
Returns a Double or Integer located at the specified location in the history. If the index passed is invalid this method returns null.

getValue

public java.lang.Object getValue(int iIndex)
Returns the Object located at the specified location in its history.
Parameters:
iIndex - The index of the value to be returned from the history being maintained by this object. If the index passed is invalid this method returns null. 0 is the "oldest" entry
Returns:
Returns a Double or Integer located at the specified location in the history. If the index passed is invalid this method returns null.

getValueAsDouble

public java.lang.Double getValueAsDouble(double dIndex)
Returns the Object located at the specified location in its history as a Double.
Parameters:
dIndex - The index of the value to be returned from the history being maintained by this object. If the index passed is invalid this method returns null.
Returns:
Returns a Double or Integer converted to Double located at the specified location in the history. If the index passed is invalid this method returns null. If this method is called for a String, it attempts to convert its contents to a Double, and if this is not possible, it returns a Double containing 0.0.

getValueAsDouble

public java.lang.Double getValueAsDouble(int iIndex)
Returns the Object located at the specified location in its history as a Double. @param DIndex The index of the value to be returned from the history being maintained by this object. If the index passed is invalid this method returns null.
Returns:
Returns a Double (or Integer converted to Double) located at the specified location in the history. If the index passed is invalid this method returns null. If this method is called for a String, it attempts to convert its contents to a Double, and if this is not possible, it returns a Double containing 0.0.

getVariance

public double getVariance()
Returns the variance of the values in the history being maintained by this object.
Returns:
Returns a double containing the variance of the values found in the history of this object.

getVarianceOldWay

public double getVarianceOldWay()
Returns the variance of the values in the history being maintained by this object.
Returns:
Returns a Double containing the variance of the values found in the history of this object.

increaseCapacity

public int increaseCapacity(int iIncrement)
Method to increase the size of history maintained by this object by the incremental amount passed. At present, only positive increments will have an affect on the size of the history maintained by this object.
Parameters:
iIncrement - The amount to grow the size of the history maintained by this object.
Returns:
returns the new capacity (size of the history) for this object. Capacity is increased in fixed size increments, so the size may be larger than requested. You can control this increment by calling the setGrowthIncrement() method.
See Also:
setGrowthIncrement(int), setCapacity(int)

incrementDataSeries

public boolean incrementDataSeries(double dIncrement)
incrementDataSeries adds the value passed to each of the values in this DataSeries. Note: the increment value may be positive or negative.
Parameters:
dIncrement - a double containing a positive or negative increment that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

incrementDataSeries

public boolean incrementDataSeries(int iIncrement)
incrementDataSeries adds the value passed to each of the values in this DataSeries. Note: the increment value may be positive or negative.
Parameters:
iIncrement - an integer containing a positive or negative increment that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

incrementDataSeries

public boolean incrementDataSeries(java.lang.Object objIncrement)
incrementDataSeries adds the value passed to each of the values in this DataSeries. Note: the increment value may be positive or negative.
Parameters:
objValue - an Object containing an Integer or Double that will be added to each value in this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

isLocked

public boolean isLocked()
Method to return locked state of this object

lock

public void lock()
Method to lock this DataSeries to force wrapping when new values are added, once the DataSeries' capacity has been reached.
See Also:
getCapacity()

log10DataSeries

public boolean log10DataSeries()
log10DataSeries takes the log (base 10) of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

logDataSeries

public boolean logDataSeries()
logDataSeries takes the natural log (base e) of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

multiplyDataSeries

public boolean multiplyDataSeries(AbleDataSeries dsMultiply)
multiplyDataSeries multiplies each of the values in this DataSeries by their corresponding value in the passed DataSeries.
Parameters:
dsMultiply - an AbleDataSeries containing values to be multiplied by this DataSeries values. The passed DataSeries must be the same length as this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

multiplyDataSeries

public boolean multiplyDataSeries(double dMulitiplier)
multiplyDataSeries multiplies the value passed to each of the values in this DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
dMulitiplier - a double containing a positive or negative multiplier that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

multiplyDataSeries

public boolean multiplyDataSeries(int iMulitiplier)
multiplyDataSeries adds the value passed to each of the values in this DataSeries. Note: the increment value may be positive or negative.
Parameters:
iMulitiplier - an integer containing a positive or negative multiplier that will be added to each value in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

multiplyDataSeries

public boolean multiplyDataSeries(java.lang.Object objMulitiplier)
multiplyDataSeries multiplies the value passed to each of the values in this DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
objValue - an Object containing an Integer or Double that will be multiplied against each value in this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (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 int 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.
Returns:
returns the capacity (size of the history) for this object. Because the capacity is increased in fixed size increments, this size may be larger than requested. To control the increment size call the setGrowthIncrement() method.

setDataSeries

public boolean setDataSeries(java.lang.Object valueArray)
setDataSeries resets the history to values supplied in the passed valueArray.
Parameters:
valueArray - an Object containing an int[], double[], or String[] which can be retrieved using the getDataArray() method.
Returns:
boolean showing the method worked (true) or failed (false)

setGrowthIncrement

public void setGrowthIncrement(int iGrowthIncrement)
Method to set the growth increment for this DataSeries history.
Parameters:
iGrowthIncrement - The amount of cells to be added to this DataSeries history. By growing in increments larger than 1 we reduce the amount of array copying required.

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.

setSeriesValueClass

public void setSeriesValueClass(java.lang.Class classType)
Method to change the kind of values being stored in the history of this DataSeries. The normal storage is hierarchically ordered, where the first attempt is to store an int[], then a double[], and finally a String[] if the values can't be converted to int or double. This method allows you to "rewrite" history by forcing a storage method based on the class type passed. Existing values will be converted whereever possible to the specified type. So, if the current history was a String[] and you asked to convert the contents to a double[] (by passing in classDouble) then any of the current Strings in the history that could be converted to double's would be preserved. Otherwise, the cell would store 0.0 as its value.
Parameters:
classType - is one of the three types: classInteger (to convert history to an int[], classDouble (to convert history to a double[]), and classString (to convert history to a String[]).
See Also:
classInteger, classDouble, classString

setValue

public boolean setValue(int iIndex,
                        java.lang.Object objValue)
Generic method to set the object passed to the ith value of the history being maintained by this object.
Parameters:
iIndex - The history cell to receive the value passed (0 == most recent entry).
objValue - The object (Integer, Double, or String) to be added to the history.

sinDataSeries

public boolean sinDataSeries()
sinDataSeries takes the sine of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

squareDataSeries

public boolean squareDataSeries()
squareDataSeries multiplies each of the values in this DataSeries by themselves storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

squarerootDataSeries

public boolean squarerootDataSeries()
squarerootDataSeries takes the square root of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

subtractDataSeries

public boolean subtractDataSeries(AbleDataSeries dsSubtract)
subtractDataSeries subtracts each of the values in this DataSeries by their corresponding value in the passed DataSeries. Note: the value may be positive or negative, whole or fraction.
Parameters:
dsSubtract - an AbleDataSeries containing values to be subtracted from this DataSeries values. The passed DataSeries must be the same length as this DataSeries. The type of object must match the type of data stored in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

tanDataSeries

public boolean tanDataSeries()
tanDataSeries takes the tangent of each of the values in this DataSeries, storing the result in this DataSeries.
Returns:
boolean showing the method worked (true) or failed (false)

unlock

public void unlock()
Method to unlock this DataSeries 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