net.sf.jagg
Class MinAggregator

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

public class MinAggregator
extends Aggregator

This class represents the "min" 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
MinAggregator(java.lang.String property)
          Constructs a MinAggregator that operates on the specified property.
 
Method Summary
 void init()
          Initialize the minimum to null.
 void iterate(java.lang.Object value)
          Store the property value if it's lower than the current minimum.
 void merge(Aggregator agg)
          Merge the given Aggregator into this one by taking the minimum of the two minimums.
 MinAggregator replicate()
          Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.
 java.lang.Comparable terminate()
          Return the minimum.
 
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

MinAggregator

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

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

replicate

public MinAggregator 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 minimum to null.

Specified by:
init in class Aggregator

iterate

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

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 minimum of the two minimums.

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

terminate

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

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


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