Skip navigation links

Overview | Package | Class | Tree | Index | Help
| 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

## com.tangosol.util.aggregator
Class AbstractBigDecimalAggregator

`java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.util.aggregator.AbstractAggregator
com.tangosol.util.aggregator.AbstractBigDecimalAggregator`

All Implemented Interfaces:
  ExternalizableLite, PortableObject, InvocableMap.EntryAggregator, InvocableMap.ParallelAwareAggregator, Serializable

Direct Known Subclasses:
  BigDecimalAverage, BigDecimalMax, BigDecimalMin, BigDecimalSum

      public abstract class AbstractBigDecimalAggregator

extends AbstractAggregator

Abstract aggregator that processes `Comparable` values extracted from a set of entries in a Map and returns a result in a form of a `BigDecimal` value. All the extracted objects will be treated as `BigDecimal`, `BigInteger` or Java `double` values. If the set of entries is empty, a `null` result is returned.

Since:
  Coherence 3.2
Author:
  gg 2006.02.13

Field Summary
`protected int` | `m_count` The count of processed entries.
`protected BigDecimal` | `m_decResult` The running result value.

Fields inherited from class com.tangosol.util.aggregator.AbstractAggregator
`m_fParallel`

Constructor Summary
`AbstractBigDecimalAggregator()` Default constructor (necessary for the ExternalizableLite interface).
`AbstractBigDecimalAggregator(String sMethod)` Construct an AbstractBigDecimalAggregator object.
`AbstractBigDecimalAggregator(ValueExtractor extractor)` Construct an AbstractBigDecimalAggregator object.

Method Summary
`static BigDecimal` | `ensureBigDecimal(Number num)` Ensure the specified Number is a BigDecimal value or convert it into a new BigDecimal object.
`protected Object` | `finalizeResult(boolean fFinal)` Obtain the result of the aggregation.
`protected void` | `init(boolean fFinal)` Initialize the aggregation result.

Methods inherited from class com.tangosol.util.aggregator.AbstractAggregator
`aggregate, aggregateResults, equals, getParallelAggregator, getValueExtractor, hashCode, process, processEntry, readExternal, readExternal, toString, writeExternal, writeExternal`

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

### m_count

    protected transient int m_count

  The count of processed entries.

### m_decResult

    protected transient BigDecimal m_decResult

  The running result value.

Constructor Detail

### AbstractBigDecimalAggregator

    public AbstractBigDecimalAggregator()

  Default constructor (necessary for the ExternalizableLite interface).

### AbstractBigDecimalAggregator

    public AbstractBigDecimalAggregator(ValueExtractor extractor)

  Construct an AbstractBigDecimalAggregator object.
  Parameters:
    `extractor` - the extractor that provides a value in the form of any Java object that is a `Number`

### AbstractBigDecimalAggregator

    public AbstractBigDecimalAggregator(String sMethod)

  Construct an AbstractBigDecimalAggregator object.
  Parameters:
    `sMethod` - the name of the method that returns a value in the form of any Java object that is a `Number`

Method Detail

### init

    protected void init(boolean fFinal)

  Initialize the aggregation result.
  Specified by:
    `init` in class `AbstractAggregator`
  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. <p/> 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`
  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

### ensureBigDecimal

    public static BigDecimal ensureBigDecimal(Number num)

  Ensure the specified Number is a BigDecimal value or convert it into a new BigDecimal object.
  Parameters:
    `num` - a Number object
  Returns:
    a BigDecimal object that is equal to the passed in Number

Skip navigation links

Overview | Package | Class | Tree | Index | Help
| 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

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.