Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.jasperreports.engine.util
Class Java15BigDecimalHandler

    java.lang.Object
      net.sf.jasperreports.engine.util.Java15BigDecimalHandler

All Implemented Interfaces:
  BigDecimalHandler

    public class Java15BigDecimalHandler

extends java.lang.Object
implements BigDecimalHandler

`BigDecimalHandler` implementation used on Java 1.5 or newer.

This implementation uses a configured minimum precision when performing divisions.

Version:
  $Id: Java15BigDecimalHandler.java 3058 2009-09-19 08:19:49Z lucianc $
Author:
  Lucian Chirita (lucianc@users.sourceforge.net)
See Also:
  `BigDecimalUtils.divide(BigDecimal, BigDecimal)`, `PROPERTY_MINIMUM_PRECISION`

Field Summary
`static java.lang.String` | `PROPERTY_MINIMUM_PRECISION` An integer property that provides the minimum precision to be used for division operations.

Constructor Summary
`Java15BigDecimalHandler()`
`Java15BigDecimalHandler(int minPrecision)`

Method Summary
`java.math.BigDecimal` | `divide(java.math.BigDecimal dividend, java.math.BigDecimal divisor)` Divides the values using the biggest of the dividend precision, the divisor precision and the configured minimum precision as result precision, and `RoundingMode.HALF_UP` as rounding mode.
`protected int` | `getDivisionPrecision(java.math.BigDecimal dividend, java.math.BigDecimal divisor)`
`protected java.math.MathContext` | `getMathContext(int precision)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PROPERTY_MINIMUM_PRECISION

    public static final java.lang.String PROPERTY_MINIMUM_PRECISION

  An integer property that provides the minimum precision to be used for division operations.

  The property can only be set globally. The default value is 16.

  See Also:
    Constant Field Values

Constructor Detail

### Java15BigDecimalHandler

    public Java15BigDecimalHandler()

### Java15BigDecimalHandler

    public Java15BigDecimalHandler(int minPrecision)

Method Detail

### divide

    public java.math.BigDecimal divide(java.math.BigDecimal dividend,
                                       java.math.BigDecimal divisor)

  Divides the values using the biggest of the dividend precision, the divisor precision and the configured minimum precision as result precision, and `RoundingMode.HALF_UP` as rounding mode.

  Specified by:
    `divide` in interface `BigDecimalHandler`
  Parameters:
    `dividend` - the dividend
    `divisor` - the divisor
  Returns:
    the division result, rounded according to the rules of the specific implementation
  See Also:
    `PROPERTY_MINIMUM_PRECISION`

### getDivisionPrecision

    protected int getDivisionPrecision(java.math.BigDecimal dividend,
                                       java.math.BigDecimal divisor)

### getMathContext

    protected java.math.MathContext getMathContext(int precision)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com