|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-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 java.util.Comparator |
m_comparator The comparator to use for comparing extracted values. |
protected int |
m_count The count of processed entries. |
protected java.lang.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(java.lang.String sMethod) Construct an AbstractComparableAggregator object. |
|
AbstractComparableAggregator(ValueExtractor extractor) Construct an AbstractComparableAggregator object. |
|
AbstractComparableAggregator(ValueExtractor extractor, java.util.Comparator comparator) Construct an AbstractComparableAggregator object. |
Method Summary | |
---|---|
protected java.lang.Object |
finalizeResult(boolean fFinal) Obtain the result of the aggregation. |
protected void |
init(boolean fFinal) Initialize the aggregation result. |
void |
readExternal(java.io.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(java.io.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 java.lang.Object m_oResult
protected java.util.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, java.util.Comparator comparator)
extractor
- the extractor that provides an object to be comparedcomparator
- the comparator used to compare the extracted objectpublic AbstractComparableAggregator(java.lang.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 java.lang.Object finalizeResult(boolean fFinal)
If the fFinal parameter is true, the returned object must be the final result of the aggregation; otherwise, the returned object will be treated as a partial result that should be incorporated into the final result.
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(java.io.DataInput in) throws java.io.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 objectjava.io.IOException
- if an I/O exception occursjava.io.NotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(java.io.DataOutput out) throws java.io.IOException
writeExternal
in interface ExternalizableLite
writeExternal
in class AbstractAggregator
out
- the DataOutput stream to write the state of this object tojava.io.IOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws java.io.IOException
readExternal
in interface PortableObject
readExternal
in class AbstractAggregator
in
- the PofReader from which to read the object's statejava.io.IOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws java.io.IOException
writeExternal
in interface PortableObject
writeExternal
in class AbstractAggregator
out
- the PofWriter to which to write the object's statejava.io.IOException
- if an I/O error occurs
|
Oracle® Coherence Java API Reference Release 3.7.1.0 E22843-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |