Class AbstractDoubleAggregator<T>

Type Parameters:
T - the type of the value to extract from
All Implemented Interfaces:
ExternalizableLite, PortableObject, InvocableMap.EntryAggregator<Object,Object,Double>, InvocableMap.StreamingAggregator<Object,Object,Object,Double>, Serializable, Cloneable
Direct Known Subclasses:
DoubleAverage, DoubleMax, DoubleMin, DoubleSum

public abstract class AbstractDoubleAggregator<T> extends AbstractAggregator<Object,Object,T,Number,Double>
Abstract aggregator that processes numeric values extracted from a set of entries in a Map. All the extracted Number objects will be treated as Java double values and the result of the aggregator is a Double. If the set of entries is empty, a null result is returned.
Since:
Coherence 3.1
Author:
cp/gg/jh 2005.07.19
See Also:
  • Field Details

    • m_count

      protected transient int m_count
      The count of processed entries.
    • m_dflResult

      protected transient double m_dflResult
      The running result value.
  • Constructor Details

    • AbstractDoubleAggregator

      public AbstractDoubleAggregator()
      Default constructor (necessary for the ExternalizableLite interface).
    • AbstractDoubleAggregator

      public AbstractDoubleAggregator(ValueExtractor<? super T,? extends Number> extractor)
      Construct an AbstractDoubleAggregator object.
      Parameters:
      extractor - the extractor that provides a value in the form of any Java object that is a Number
    • AbstractDoubleAggregator

      public AbstractDoubleAggregator(String sMethod)
      Construct an AbstractDoubleAggregator object.
      Parameters:
      sMethod - the name of the method that returns a value in the form of any Java object that is a Number
  • Method Details

    • init

      protected void init(boolean fFinal)
      Initialize the aggregation result.
      Specified by:
      init in class AbstractAggregator<Object,Object,T,Number,Double>
      Parameters:
      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 initialized
    • finalizeResult

      protected Object finalizeResult(boolean fFinal)
      Obtain the result of the aggregation.

      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.

      Specified by:
      finalizeResult in class AbstractAggregator<Object,Object,T,Number,Double>
      Parameters:
      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 used
      Returns:
      the result of the aggregation process