|
||||||||||
| 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.GeometricMeanAggregator
public class GeometricMeanAggregator
This class represents the "geometric mean" aggregator over numeric values.
| Field Summary |
|---|
| Fields inherited from class net.sf.jagg.Aggregator |
|---|
PROP_SELF |
| Constructor Summary | |
|---|---|
GeometricMeanAggregator(java.lang.String property)
Constructs an GeometricMeanAggregator that operates on the specified
property. |
|
| Method Summary | |
|---|---|
void |
init()
Initialize the product to one and count to zero. |
void |
iterate(java.lang.Object value)
If not null, multiply the property value into the product and count it. |
void |
merge(Aggregator agg)
Merge the given Aggregator into this one by multiplying
products and adding sums. |
GeometricMeanAggregator |
replicate()
Returns an uninitialized copy of this Aggregator object,
with the same property(ies) to analyze. |
java.lang.Double |
terminate()
Return the geometric mean by taking the nth root of the product of all values, where n is the count of all non-null values. |
DoubleDouble |
terminateDoubleDouble()
Return the result as a DoubleDouble. |
| Methods inherited from class net.sf.jagg.Aggregator |
|---|
equals, getAggregator, getAggregator, getProperty, getValueFromProperty, hashCode, isInUse, setInUse, setProperty, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GeometricMeanAggregator(java.lang.String property)
GeometricMeanAggregator that operates on the specified
property.
property - Calculate the geometric mean of this property's values.| Method Detail |
|---|
public GeometricMeanAggregator replicate()
Aggregator object,
with the same property(ies) to analyze.
replicate in class AggregatorAggregator object.public void init()
init in class Aggregatorpublic void iterate(java.lang.Object value)
iterate in class Aggregatorvalue - The value to aggregate.Aggregator.getValueFromProperty(java.lang.Object, java.lang.String)public void merge(Aggregator agg)
Aggregator into this one by multiplying
products and adding sums.
merge in class Aggregatoragg - The Aggregator to merge into this one.public java.lang.Double terminate()
terminate in class AggregatorDouble. Could return
NaN if no values have been accumulated.public DoubleDouble terminateDoubleDouble()
DoubleDouble. This is used mainly
when other Aggregators that use this result must maintain a
high precision.
terminateDoubleDouble in class AggregatorDoubleDouble, or
NaN if no values have been accumulated.DoubleDouble
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||