|
||||||||||
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.ModeAggregator
public class ModeAggregator
This class represents the "mode" aggregator over Comparable
values.
Field Summary |
---|
Fields inherited from class net.sf.jagg.Aggregator |
---|
PROP_SELF |
Constructor Summary | |
---|---|
ModeAggregator(java.lang.String property)
Constructs a ModeAggregator that operates on the specified
property. |
Method Summary | |
---|---|
void |
init()
Initialize an internal list to empty. |
void |
iterate(java.lang.Object value)
Make sure the second property's value is not null, then add the entire Object to an internal list. |
void |
merge(Aggregator agg)
Merge the given Aggregator into this one by adding the
contents of the given Aggregator's internal list into this
Aggregator's internal list. |
ModeAggregator |
replicate()
Returns an uninitialized copy of this Aggregator object,
with the same property(ies) to analyze. |
java.lang.Comparable |
terminate()
Return the value among the values in the specified property that occurs most often (the statistical mode), or any of the modes if there is more than one, with the following algorithm: Sort the internal list with respect to all values, using Collections.sort . |
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 |
---|
public ModeAggregator(java.lang.String property)
ModeAggregator
that operates on the specified
property.
property
- Determine the statistical mode of this property's values.Method Detail |
---|
public ModeAggregator replicate()
Aggregator
object,
with the same property(ies) to analyze.
replicate
in class Aggregator
Aggregator
object.public void init()
init
in class Aggregator
public void iterate(java.lang.Object value)
Object
to an internal list.
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 by adding the
contents of the given Aggregator's
internal list into this
Aggregator's
internal list.
merge
in class Aggregator
agg
- The Aggregator
to merge into this one.public java.lang.Comparable terminate()
Collections.sort
.
terminate
in class Aggregator
Collections.sort(java.util.List)
,
ComparableComparator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |