net.sf.jagg
Class MaxAggregator

java.lang.Object
  extended by net.sf.jagg.Aggregator
      extended by net.sf.jagg.MaxAggregator

public class MaxAggregator
extends Aggregator

This class represents the "max" aggregator over Comparable values.

Since:
0.1.0
Author:
Randy Gettman

Field Summary
 
Fields inherited from class net.sf.jagg.Aggregator
PROP_SELF
 
Constructor Summary
MaxAggregator(java.lang.String property)
          Constructs a MaxAggregator that operates on the specified property.
 
Method Summary
 void init()
          Initialize the maximum to null.
 void iterate(java.lang.Object value)
          Store the property value if it's higher than the current maximum.
 void merge(Aggregator agg)
          Merge the given Aggregator into this one by taking the maximum of the two maximums.
 MaxAggregator replicate()
          Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.
 java.lang.Comparable terminate()
          Return the maximum.
 
Methods inherited from class net.sf.jagg.Aggregator
equals, getAggregator, getAggregator, getProperty, getValueFromProperty, hashCode, isInUse, setInUse, setProperty, terminateDoubleDouble, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MaxAggregator

public MaxAggregator(java.lang.String property)
Constructs a MaxAggregator that operates on the specified property.

Parameters:
property - Determine the maximum of this property's values.
Method Detail

replicate

public MaxAggregator replicate()
Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.

Specified by:
replicate in class Aggregator
Returns:
An uninitialized copy of this Aggregator object.

init

public void init()
Initialize the maximum to null.

Specified by:
init in class Aggregator

iterate

public void iterate(java.lang.Object value)
Store the property value if it's higher than the current maximum.

Specified by:
iterate in class Aggregator
Parameters:
value - The value to aggregate.
See Also:
Aggregator.getValueFromProperty(java.lang.Object, java.lang.String)

merge

public void merge(Aggregator agg)
Merge the given Aggregator into this one by taking the maximum of the two maximums.

Specified by:
merge in class Aggregator
Parameters:
agg - The Aggregator to merge into this one.

terminate

public java.lang.Comparable terminate()
Return the maximum.

Specified by:
terminate in class Aggregator
Returns:
The maximum as a Comparable, or null if no values were processed.


Copyright © 2010-2013 jAgg Team. All Rights Reserved.