Class AbstractComparableAggregator<T,​R>

    • Field Detail

      • m_count

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

        protected transient R m_oResult
        The running result value.
      • m_comparator

        protected Comparator<? super R> m_comparator
        The comparator to use for comparing extracted values.
    • Constructor Detail

      • AbstractComparableAggregator

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

        public AbstractComparableAggregator​(ValueExtractor<? super T,​? extends E> extractor)
        Construct an AbstractComparableAggregator object.
        Parameters:
        extractor - the extractor that provides a value in the form of any object that implements the Comparable interface
      • AbstractComparableAggregator

        public AbstractComparableAggregator​(ValueExtractor<? super T,​? extends R> extractor,
                                            Comparator<? super R> comparator)
        Construct an AbstractComparableAggregator object.
        Parameters:
        extractor - the extractor that provides an object to be compared
        comparator - the comparator used to compare the extracted object
      • AbstractComparableAggregator

        public AbstractComparableAggregator​(String sMethod)
        Construct an AbstractComparableAggregator object.
        Parameters:
        sMethod - the name of the method that returns a value in the form of any object that implements the Comparable interface
    • Method Detail

      • init

        protected void init​(boolean fFinal)
        Initialize the aggregation result.
        Specified by:
        init in class AbstractAggregator<Object,​Object,​T,​R,​R>
        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 R 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,​R,​R>
        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