Android
java.math
public final enum

java.math.RoundingMode

java.lang.Object
java.lang.Enum<E extends java.lang.Enum<E>> Serializable Comparable<T>
java.math.RoundingMode

An enum to specify the rounding behaviour for operations whose results cannot be represented exactly.

Summary

Enum Values

RoundingMode  CEILING  Rounding mode to round towards positive infinity. 
RoundingMode  DOWN  Rounding mode where the values are rounded towards zero. 
RoundingMode  FLOOR  Rounding mode to round towards negative infinity. 
RoundingMode  HALF_DOWN  Rounding mode where values are rounded towards the nearest neighbour. 
RoundingMode  HALF_EVEN  Rounding mode where values are rounded towards the nearest neighbour. 
RoundingMode  HALF_UP  Rounding mode where values are rounded towards the nearest neighbour. 
RoundingMode  UNNECESSARY  Rounding mode where the rounding operations throws an ArithmeticException for the case that rounding is necessary, i.e. 
RoundingMode  UP  Rounding mode where positive values are rounded towards positive infinity and negative values towards negative infinity. 

Public Methods

      static    RoundingMode  valueOf(String name)
      static    RoundingMode  valueOf(int rM)
Converts rounding mode constants from class BigDecimal into RoundingMode values.
    final  static    RoundingMode[]  values()
Methods inherited from class java.lang.Enum
Methods inherited from class java.lang.Object
Methods inherited from interface java.lang.Comparable

Details

Enum Values

public static final RoundingMode CEILING

Rounding mode to round towards positive infinity. For positive values this rounding mode behaves as UP, for negative values as DOWN. Rule: x.round() >= x

public static final RoundingMode DOWN

Rounding mode where the values are rounded towards zero. Rule: x.round().abs() <= x.abs()

public static final RoundingMode FLOOR

Rounding mode to round towards negative infinity. For positive values this rounding mode behaves as DOWN, for negative values as UP. Rule: x.round() <= x

public static final RoundingMode HALF_DOWN

Rounding mode where values are rounded towards the nearest neighbour. Ties are broken by rounding down.

public static final RoundingMode HALF_EVEN

Rounding mode where values are rounded towards the nearest neighbour. Ties are broken by rounding to the even neighbour.

public static final RoundingMode HALF_UP

Rounding mode where values are rounded towards the nearest neighbour. Ties are broken by rounding up.

public static final RoundingMode UNNECESSARY

Rounding mode where the rounding operations throws an ArithmeticException for the case that rounding is necessary, i.e. for the case that the value cannot be represented exactly.

public static final RoundingMode UP

Rounding mode where positive values are rounded towards positive infinity and negative values towards negative infinity. Rule: x.round().abs() >= x.abs()

Public Methods

public static RoundingMode valueOf(String name)

public static RoundingMode valueOf(int rM)

Converts rounding mode constants from class BigDecimal into RoundingMode values.

Parameters

rM rounding mode constant as defined in class BigDecimal

Returns

  • corresponding rounding mode object

public static final RoundingMode[] values()

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48