|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.AbleObject | +--com.ibm.able.beans.AbleDataSeries
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.
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Class classClass
public static final java.lang.Class classDouble
public static final java.lang.Class classDoubleArray
classDouble
public static final java.lang.Class classIntArray
classInteger
public static final java.lang.Class classInteger
public static final java.lang.Class classString
public static final java.lang.Class classStringArray
classString
public static final boolean DEFAULT_CALC_ON_ADD
public static final int DEFAULT_GROWTH_INCREMENT
public static final boolean DEFAULT_HAS_TITLES
public static final int DEFAULT_HISTORY_SIZE
public static final int INVALID_INDEX
public static final java.lang.String strUnknown
Constructor Detail |
public AbleDataSeries()
DEFAULT_CALC_ON_ADD
public AbleDataSeries(boolean bCalcOnAdd)
bCalcOnAdd
- boolean flag determining whether (true) or not (false)
statistical calculations should be kept up to date when data is added
to the history.public AbleDataSeries(int iCapacity)
iCapacity
- The size of the circular buffer (array) used to maintain
history.DEFAULT_CALC_ON_ADD
public AbleDataSeries(int iCapacity, boolean bCalcOnAdd)
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.public AbleDataSeries(int iCapacity, java.lang.Object objArrayType)
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.DEFAULT_CALC_ON_ADD
public AbleDataSeries(int iCapacity, java.lang.Object objArrayType, boolean bCalcOnAdd)
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.public AbleDataSeries(java.util.Vector vectContent)
vectContent
- The List (Vector) containing the seed elements for the
initial history.DEFAULT_CALC_ON_ADD
public AbleDataSeries(java.util.Vector vectContent, boolean bCalcOnAdd)
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.public AbleDataSeries(java.lang.Double[] DArray)
DArray
- The array of Doubles containing the seed elements for the
initial history.DEFAULT_CALC_ON_ADD
public AbleDataSeries(java.lang.Double[] DArray, boolean bCalcOnAdd)
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.public AbleDataSeries(java.lang.Integer[] IArray)
IArray
- The array of Integers containing the seed elements for the
initial history.DEFAULT_CALC_ON_ADD
public AbleDataSeries(java.lang.Integer[] IArray, boolean bCalcOnAdd)
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 |
public static java.lang.String Copyright()
public boolean absDataSeries()
public boolean acosDataSeries()
public boolean addDataSeries(AbleDataSeries dsAdd)
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.public void addValue(double dValue)
dValue
- The value to be added to the history.public void addValue(java.lang.Double DValue)
DValue
- The value to be added to the history of this object.public void addValue(int iValue)
iValue
- The value to be added to the history of this object.public void addValue(java.lang.Integer IValue)
IValue
- The value to be added to the history of this object.public void addValue(java.lang.Object objValue)
objValue
- The object (Integer or Double) to be added to the history.public void addValue(java.lang.String strValue)
strValue
- The value to be added to the history of this object.public java.lang.Double append(AbleDataSeries appendSeries)
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.public boolean asinDataSeries()
public boolean atanDataSeries()
public void clear()
public java.lang.String contentsAsString()
public java.lang.String contentsAsString(int iBreakCount)
iBreakCount
- inserts a newline after this number of entries
has been added to the output String.public boolean cosDataSeries()
public boolean deltaDataSeries()
public boolean divideDataSeries(AbleDataSeries dsDivisor)
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.public boolean divideDataSeries(double dDivisor)
dDivisor
- a double containing a positive or negative increment
that will be added to each value in this DataSeries.public boolean divideDataSeries(int iDivisor)
iDivisor
- an integer containing a positive or negative increment
that will be added to each value in this DataSeries.public boolean divideDataSeries(java.lang.Object objDivisor)
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.public boolean expDataSeries()
public double getAverage()
public boolean getCalcOnAdd()
public int getCapacity()
public int getCount()
public java.lang.Object getDataArray()
classIntArray
,
classDoubleArray
,
classStringArray
public AbleDataSeries getDataSeries()
public AbleDataSeries getDataSeries(int[] iIndices)
iIndices
- is an array of indices (int[]) to be copied from
this DataSeries into the one being returned.public int getGrowthIncrement()
public double getMaximum()
public int getMaximumAsInt()
public double getMinimum()
public int getMinimumAsInt()
public java.lang.Class getSeriesClass()
classIntArray
,
classDoubleArray
,
classStringArray
public java.lang.Class getSeriesValueClass()
classInteger
,
classDouble
,
classString
public double getStdDeviation()
public double getSum()
public int getSumAsInt()
public double getSumSquared()
public int getSumSquaredAsInt()
public java.lang.Object getValue(double dIndex)
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.public java.lang.Object getValue(int iIndex)
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" entrypublic java.lang.Double getValueAsDouble(double dIndex)
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.public java.lang.Double getValueAsDouble(int iIndex)
public double getVariance()
public double getVarianceOldWay()
public int increaseCapacity(int iIncrement)
iIncrement
- The amount to grow the size of the history maintained by
this object.setGrowthIncrement(int)
,
setCapacity(int)
public boolean incrementDataSeries(double dIncrement)
dIncrement
- a double containing a positive or negative increment
that will be added to each value in this DataSeries.public boolean incrementDataSeries(int iIncrement)
iIncrement
- an integer containing a positive or negative increment
that will be added to each value in this DataSeries.public boolean incrementDataSeries(java.lang.Object objIncrement)
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.public boolean isLocked()
public void lock()
getCapacity()
public boolean log10DataSeries()
public boolean logDataSeries()
public boolean multiplyDataSeries(AbleDataSeries dsMultiply)
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.public boolean multiplyDataSeries(double dMulitiplier)
dMulitiplier
- a double containing a positive or negative multiplier
that will be added to each value in this DataSeries.public boolean multiplyDataSeries(int iMulitiplier)
iMulitiplier
- an integer containing a positive or negative multiplier
that will be added to each value in this DataSeries.public boolean multiplyDataSeries(java.lang.Object objMulitiplier)
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.public void setCalcOnAdd(boolean bCalcOnAdd)
BCalcOnAdd
- defines whether (true) or not (false) statistical
calculations are performed when values are added to the history
maintained by this object.public int setCapacity(int iCapacity)
iCapacity
- The desired size of the history maintained by this object.public boolean setDataSeries(java.lang.Object valueArray)
valueArray
- an Object containing an int[], double[], or
String[] which can be retrieved using the getDataArray() method.public void setGrowthIncrement(int iGrowthIncrement)
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.public void setLocked(boolean bLocked)
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.public void setSeriesValueClass(java.lang.Class classType)
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[]).classInteger
,
classDouble
,
classString
public boolean setValue(int iIndex, java.lang.Object objValue)
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.public boolean sinDataSeries()
public boolean squareDataSeries()
public boolean squarerootDataSeries()
public boolean subtractDataSeries(AbleDataSeries dsSubtract)
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.public boolean tanDataSeries()
public void unlock()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |