org.zkoss.pivot.impl.calc
Class Numbers

java.lang.Object
  extended by org.zkoss.pivot.impl.calc.Numbers

public class Numbers
extends java.lang.Object

Utilities of arithmetic operations.

Author:
simonpai

Nested Class Summary
static class Numbers.MixedTypedNumber
           
 
Field Summary
static byte DOUBLE
          Double type.
static byte INTEGER
          Integer type.
static byte LONG
          Long type.
static byte NULL
          null value.
 
Constructor Summary
Numbers()
           
 
Method Summary
static java.lang.Number divide(java.lang.Number n, int divisor)
          Divide a Number by an int with automatic casting.
static byte getTypeBound(java.lang.Number n)
          Return the minimal variable type required to hold the number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final byte NULL
null value.

See Also:
Constant Field Values

INTEGER

public static final byte INTEGER
Integer type.

See Also:
Constant Field Values

LONG

public static final byte LONG
Long type.

See Also:
Constant Field Values

DOUBLE

public static final byte DOUBLE
Double type.

See Also:
Constant Field Values
Constructor Detail

Numbers

public Numbers()
Method Detail

getTypeBound

public static byte getTypeBound(java.lang.Number n)
Return the minimal variable type required to hold the number.

Returns:
either Numbers.NULL, Numbers.INTEGER, Numbers.LONG, or Numbers.DOUBLE

divide

public static java.lang.Number divide(java.lang.Number n,
                                      int divisor)
Divide a Number by an int with automatic casting.



Copyright © 2012. All Rights Reserved.