|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.util.aggregator.AbstractAggregator
com.tangosol.util.aggregator.AbstractComparableAggregator
public abstract class AbstractComparableAggregator
Abstract aggregator that processes values extracted from a set of entries in a Map, with knowledge of how to compare those values. There are two way to use the AbstractComparableAggregator:
Comparable
, orComparator
object.If the set of entries passed to AbstractAggregator.aggregate(java.util.Set)
is empty, a null result is returned.
Field Summary | |
---|---|
protected Comparator |
m_comparator The comparator to use for comparing extracted values. |
protected int |
m_count The count of processed entries. |
protected Object |
m_oResult The running result value. |
Fields inherited from class com.tangosol.util.aggregator.AbstractAggregator |
---|
m_fParallel |
Constructor Summary | |
---|---|
AbstractComparableAggregator() Default constructor (necessary for the ExternalizableLite interface). |
|
AbstractComparableAggregator(String sMethod) Construct an AbstractComparableAggregator object. |
|
AbstractComparableAggregator(ValueExtractor extractor) Construct an AbstractComparableAggregator object. |
|
AbstractComparableAggregator(ValueExtractor extractor, Comparator comparator) Construct an AbstractComparableAggregator object. |
Method Summary | |
---|---|
protected Object |
finalizeResult(boolean fFinal) Obtain the result of the aggregation. |
protected void |
init(boolean fFinal) Initialize the aggregation result. |
void |
readExternal(DataInput in) Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in) Restore the contents of a user type instance by reading its state using the specified PofReader object. |
void |
writeExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
Methods inherited from class com.tangosol.util.aggregator.AbstractAggregator |
---|
aggregate, aggregateResults, equals, getParallelAggregator, getValueExtractor, hashCode, process, processEntry, toString |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Field Detail |
---|
protected transient int m_count
protected transient Object m_oResult
protected Comparator m_comparator
Constructor Detail |
---|
public AbstractComparableAggregator()
public AbstractComparableAggregator(ValueExtractor extractor)
extractor
- the extractor that provides a value in the form of any object that implements the Comparable
interfacepublic AbstractComparableAggregator(ValueExtractor extractor, Comparator comparator)
extractor
- the extractor that provides an object to be comparedcomparator
- the comparator used to compare the extracted objectpublic AbstractComparableAggregator(String sMethod)
sMethod
- the name of the method that returns a value in the form of any object that implements the Comparable
interfaceMethod Detail |
---|
protected void init(boolean fFinal)
init
in class AbstractAggregator
fFinal
- true is passed if the aggregation process that is being initialized must produce a final aggregation result; this will only be false if a parallel approach is being used and the initial (partial) aggregation process is being initializedprotected Object finalizeResult(boolean fFinal)
finalizeResult
in class AbstractAggregator
fFinal
- true to indicate that the final result of the aggregation process should be returned; this will only be false if a parallel approach is being usedpublic void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
readExternal
in class AbstractAggregator
in
- the DataInput stream to read data from in order to restore the state of this objectIOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
writeExternal
in class AbstractAggregator
out
- the DataOutput stream to write the state of this object toIOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
readExternal
in interface PortableObject
readExternal
in class AbstractAggregator
in
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
writeExternal
in interface PortableObject
writeExternal
in class AbstractAggregator
out
- the PofWriter to which to write the object's stateIOException
- if an I/O error occurs
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |