API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.math. RoundingMode View Source
Author(s)
Josh Bloch
Mike Cowlishaw
Joseph D. Darcy
Since
1.5
Version
1.x 01/xx/xx
Serial
Hierarchy
 Object
      Enum
          RoundingMode
Implements
Subclasses
Description
publicfinal enum RoundingMode
  Specifies a rounding behavior for numerical operations capable of discarding precision.
See also:    BigDecimal MathContext
Enum Constants
UP
  Rounding mode to round away from zero.
DOWN
  Rounding mode to round towards zero.
CEILING
  Rounding mode to round towards positive infinity.
FLOOR
  Rounding mode to round towards negative infinity.
HALF_UP
  Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round up.
HALF_DOWN
  Rounding mode to round towards "nearest neighbor" unless both neighbors are equidistant, in which case round down.
HALF_EVEN
  Rounding mode to round towards the "nearest neighbor" unless both neighbors are equidistant, in which case, round towards the even neighbor.
UNNECESSARY
  Rounding mode to assert that the requested operation has an exact result, hence no rounding is necessary.
Methods
Hide/Show inherited methods
protectedfinal Object clone () throws CloneNotSupportedException [Inherited From Enum]
  Throws CloneNotSupportedException.
publicfinal int compareTo ( E o) [Inherited From Enum]
  Compares this enum with the specified object for order.
publicfinal boolean equals (Object other) [Inherited From Enum]
  Returns true if the specified object is equal to this enum constant.
protectedfinal void finalize () [Inherited From Enum]
enum classes cannot have finalize methods.
publicfinal Class< E> getDeclaringClass () [Inherited From Enum]
  Returns the Class object corresponding to this enum constant's enum type.
publicfinal int hashCode () [Inherited From Enum]
  Returns a hash code for this enum constant.
publicfinal String name () [Inherited From Enum]
  Returns the name of this enum constant, exactly as declared in its enum declaration.
publicfinal int ordinal () [Inherited From Enum]
  Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
public String toString () [Inherited From Enum]
  Returns the name of this enum constant, as contained in the declaration.
publicstatic T valueOf (Class< T> enumType, String name) [Inherited From Enum]
  Returns the enum constant of the specified enum type with the specified name.
publicstatic RoundingMode valueOf (int rm)
  Returns the RoundingMode object corresponding to a legacy integer rounding mode constant in BigDecimal.
publicstatic RoundingMode valueOf (String name)
publicfinalstatic RoundingMode values ()
Fields
Hide/Show inherited fields
pack-privatefinal int oldMode
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar