net.sf.jagg
Class CollectAggregator

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

public class CollectAggregator
extends Aggregator

This class allows represents the "collect" aggregator over any values.

Since:
0.6.0
Author:
Randy Gettman

Field Summary
 
Fields inherited from class net.sf.jagg.Aggregator
PROP_SELF
 
Constructor Summary
CollectAggregator(java.lang.String property)
          Constructs a CollectAggregator that operates on the specified property.
 
Method Summary
 void init()
          Initialize the list to empty.
 void iterate(java.lang.Object value)
          If not null, append the property to the list.
 void merge(Aggregator agg)
          Merge the given Aggregator into this one by adding all elements of the other list to this one.
 CollectAggregator replicate()
          Returns an uninitialized copy of this Aggregator object, with the same property(ies) to analyze.
 java.util.List<java.lang.Object> terminate()
          Return the list.
 
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

CollectAggregator

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

Parameters:
property - Collect this property's values into a List.
Method Detail

replicate

public CollectAggregator 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 list to empty.

Specified by:
init in class Aggregator

iterate

public void iterate(java.lang.Object value)
If not null, append the property to the list.

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 adding all elements of the other list to this one.

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

terminate

public java.util.List<java.lang.Object> terminate()
Return the list.

Specified by:
terminate in class Aggregator
Returns:
The List of objects.


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