Class AbstractComparableAggregator
Abstract aggregator that processes values extracted from a set of entries in a cache, with knowledge of how to compare those values.
Inherited Members
Namespace: Tangosol.Util.Aggregator
Assembly: Coherence.dll
Syntax
public abstract class AbstractComparableAggregator : AbstractAggregator, IParallelAwareAggregator, IEntryAggregator, IPortableObject
Remarks
There are two way to use the AbstractComparableAggregator:
- All the extracted objects must implement IComparable, or
- The AbstractComparableAggregator has to be provided with an IComparer object.
Constructors
AbstractComparableAggregator()
Default constructor.
Declaration
public AbstractComparableAggregator()
AbstractComparableAggregator(string)
Construct an AbstractComparableAggregator object.
Declaration
public AbstractComparableAggregator(string member)
Parameters
Type | Name | Description |
---|---|---|
string | member | The name of the member that returns a value in the form of any object that implements the IComparable interface. |
AbstractComparableAggregator(IValueExtractor)
Construct an AbstractComparableAggregator object.
Declaration
public AbstractComparableAggregator(IValueExtractor extractor)
Parameters
Type | Name | Description |
---|---|---|
IValueExtractor | extractor | The IValueExtractor that provides a value in the form of any object that implements the IComparable interface. |
AbstractComparableAggregator(IValueExtractor, IComparer)
Construct an AbstractComparableAggregator object.
Declaration
public AbstractComparableAggregator(IValueExtractor extractor, IComparer comparer)
Parameters
Type | Name | Description |
---|---|---|
IValueExtractor | extractor | The extractor that provides an object to be compared. |
IComparer | comparer | The comparer used to compare the extracted object. |
Fields
m_comparer
The comparer to use for comparing extracted values.
Declaration
protected IComparer m_comparer
Field Value
Type | Description |
---|---|
IComparer |
m_count
The count of processed entries.
Declaration
[NonSerialized]
protected int m_count
Field Value
Type | Description |
---|---|
int |
m_result
The running result value.
Declaration
[NonSerialized]
protected object m_result
Field Value
Type | Description |
---|---|
object |
Methods
FinalizeResult(bool)
Obtain the result of the aggregation.
Declaration
protected override object FinalizeResult(bool isFinal)
Parameters
Type | Name | Description |
---|---|---|
bool | isFinal | 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 used. |
Returns
Type | Description |
---|---|
object | The result of the aggregation process. |
Overrides
Remarks
If the isFinal
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.
Init(bool)
Initialize the aggregation result.
Declaration
protected override void Init(bool isFinal)
Parameters
Type | Name | Description |
---|---|---|
bool | isFinal | 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 initialized. |
Overrides
ReadExternal(IPofReader)
Restore the contents of a user type instance by reading its state using the specified IPofReader object.
Declaration
public override void ReadExternal(IPofReader reader)
Parameters
Type | Name | Description |
---|---|---|
IPofReader | reader | The IPofReader from which to read the object's state. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
WriteExternal(IPofWriter)
Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.
Declaration
public override void WriteExternal(IPofWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IPofWriter | writer | The IPofWriter to which to write the object's state. |
Overrides
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |