edu.brook.ascape.util
Class DataSeries
java.lang.Object
|
+--edu.brook.ascape.util.StatCollector
|
+--edu.brook.ascape.util.StatCollectorCSA
|
+--edu.brook.ascape.util.StatCollectorCSAMM
|
+--edu.brook.ascape.util.DataSeries
- public abstract class DataSeries
- extends StatCollectorCSAMM
A class which stores the results of measurements of data points. Comprehensive statistics are kept
for the series as a whole. Ordinarily, you should not have to work with this class
unless you are creating custom measurement types or collecting different kinds of
data. You do not usually need to subclass this class directly; a stat factory
creates the appropriate implementations.
Confused? A data series keeps track of the overall count, sum, average, minimum, maximum
for every piece of data collected, so it 'is-a' StatCollectorCSAMM. But it keeps the data stat for
that data as well, and it records just one measure of that stat, be it count, sum, average, minimum,
maximum, etc. so it 'has-a' DataPoint.
See StatCollectorCountSumAvg for an example.
- Since:
- 1.0
- Version:
- 1.0.2
- See Also:
StatCollector.createDataSeries(),
StatCollectorCSA
|
Field Summary |
protected DataPoint |
point
The value point this series is tracking. |
protected java.util.Vector |
series
A series of double values. |
|
Constructor Summary |
DataSeries()
Constructs a new data series. |
|
Method Summary |
void |
addValue()
Adds a new value to the series. |
void |
clear()
Clears the series of all values. |
DataPoint |
getDataPoint()
Returns the data point that this series is recording. |
abstract java.lang.String |
getMeasureName()
Overridden to return a (english for now) name for the type of measure
being recorded; for example, "Minimum." |
java.lang.String |
getName()
Returns the name of this data series. |
abstract double |
getValue()
Overridden to return the current value of the measure used for this series. |
double |
getValue(java.lang.Object object)
Overrides the superclasses abstract method, to call the getValue
method of this class. |
void |
setDataPoint(DataPoint point)
Sets the data point that this series shoudl record. |
java.util.Vector |
toVector()
Returns a vector holding the entire series as a vector of doubles. |
| Methods inherited from class edu.brook.ascape.util.StatCollector |
addValueFor,
calculateValue,
createDataSeries,
getAllDataSeries,
getAllMeasureNames,
getAllMeasureNamesShort,
getCount,
getDataSeries,
isAutoCollect,
isCalculated,
isPhase2,
setAutoCollect,
setName |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
series
protected java.util.Vector series
- A series of double values.
point
protected DataPoint point
- The value point this series is tracking.
DataSeries
public DataSeries()
- Constructs a new data series.
toVector
public java.util.Vector toVector()
- Returns a vector holding the entire series as a vector of doubles.
clear
public void clear()
- Clears the series of all values.
- Overrides:
- clear in class StatCollectorCSAMM
addValue
public void addValue()
- Adds a new value to the series.
getValue
public abstract double getValue()
- Overridden to return the current value of the measure used for this series.
For example, if this series is intended to track minimums, this method
might return
((StatCollectorCSAMM) point).getMin()
- See Also:
StatCollector.createDataSeries()
getValue
public final double getValue(java.lang.Object object)
- Overrides the superclasses abstract method, to call the getValue
method of this class. Object is ignored, since this data series
is interested in one and only one object; its value point.
- Parameters:
object - normally the object we're interested in, ignored here- Overrides:
- getValue in class StatCollector
getMeasureName
public abstract java.lang.String getMeasureName()
- Overridden to return a (english for now) name for the type of measure
being recorded; for example, "Minimum."
getName
public java.lang.String getName()
- Returns the name of this data series. By default, the measure name and
the value being measured; for example, "Minimum Age."
- Overrides:
- getName in class StatCollector
getDataPoint
public DataPoint getDataPoint()
- Returns the data point that this series is recording.
setDataPoint
public void setDataPoint(DataPoint point)
- Sets the data point that this series shoudl record.