|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jagg.Aggregator
net.sf.jagg.TwoPropAggregator
net.sf.jagg.AbstractCovarianceAggregator
public abstract class AbstractCovarianceAggregator
This abstract class represents covariance-like aggregator calculations over numeric values.
Field Summary | |
---|---|
protected long |
myCount
A running count of items processed so far where BOTH properties yield non-null values. |
protected DoubleDouble |
mySum1
A running sum of items processed so far for the FIRST property. |
protected DoubleDouble |
mySum2
A running sum of items processed so far for the SECOND property. |
protected DoubleDouble |
myVarNumerator
A running total of the variance, before it is divided by the denominator in the variance calculation. |
Fields inherited from class net.sf.jagg.Aggregator |
---|
PROP_SELF |
Constructor Summary | |
---|---|
AbstractCovarianceAggregator(java.lang.String properties)
Constructs a CovarianceAggregator on the specified
properties, in the format: property, property2 . |
|
AbstractCovarianceAggregator(java.lang.String property,
java.lang.String property2)
Constructs a CovarianceAggregator that operates on the specified
properties. |
Method Summary | |
---|---|
void |
init()
Initialize the sums, count, and variance numerator to zero. |
void |
iterate(java.lang.Object value)
Count only if both properties are non-null. |
void |
merge(Aggregator agg)
Merge the given Aggregator into this one. |
Methods inherited from class net.sf.jagg.TwoPropAggregator |
---|
getProperty2, setProperty, toString |
Methods inherited from class net.sf.jagg.Aggregator |
---|
equals, getAggregator, getAggregator, getProperty, getValueFromProperty, hashCode, isInUse, replicate, setInUse, terminate, terminateDoubleDouble |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected long myCount
protected DoubleDouble mySum1
protected DoubleDouble mySum2
protected DoubleDouble myVarNumerator
Constructor Detail |
---|
public AbstractCovarianceAggregator(java.lang.String properties)
CovarianceAggregator
on the specified
properties, in the format: property, property2
.
properties
- A specification string in the format:
property, property2
.public AbstractCovarianceAggregator(java.lang.String property, java.lang.String property2)
CovarianceAggregator
that operates on the specified
properties.
property
- Determine the covariance of this property with the other.property2
- Determine the covariance of this property with the other.Method Detail |
---|
public void init()
init
in class Aggregator
public void iterate(java.lang.Object value)
iterate
in class Aggregator
value
- The value to aggregate.Aggregator.getValueFromProperty(java.lang.Object, java.lang.String)
public void merge(Aggregator agg)
Aggregator
into this one. Add the sums
together. Add in the count. Update the variance numerator.
merge
in class Aggregator
agg
- The Aggregator
to merge into this one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |