|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntegerArithmetic<T extends java.lang.Number>
Defines arithmetic operations appropriate for Integral Numbers.
An implementation of IntegerArithmetic for classes (such as BigInteger) that provide the appropriate operations can simply map these methods to the methods provided by the Number. For the reference types, the implementation will need to dereference the arguments, perform the specified operation on the resulting primitives, and box up the result in a new reference type.
Implementations of IntegerArithmetic for user-defined Number classes must be registered with the ArithmeticFactory class. See the Arithmetic class for details.
Copyright © 2003-2005 David A. Hall
Method Summary | |
---|---|
T |
and(T x,
T y)
For numeric arguments x and y, returns x & y |
T |
modulus(T x,
T y)
For numeric arguments x and y, returns x % y |
T |
not(T x)
For numeric arguments x, returns ~x |
T |
or(T x,
T y)
For numeric arguments x and y, returns x | y |
T |
shiftLeft(T x,
java.lang.Integer y)
|
T |
signedShiftRight(T x,
java.lang.Integer y)
|
T |
unsignedShiftRight(T x,
java.lang.Integer y)
Optional. |
T |
xor(T x,
T y)
For numeric arguments x and y, returns x ^ y |
Methods inherited from interface net.sf.jga.fn.arithmetic.Arithmetic |
---|
divides, minus, multiplies, negate, one, plus, valueOf, zero |
Method Detail |
---|
T modulus(T x, T y)
T and(T x, T y)
T or(T x, T y)
T xor(T x, T y)
T not(T x)
T shiftLeft(T x, java.lang.Integer y)
T signedShiftRight(T x, java.lang.Integer y)
T unsignedShiftRight(T x, java.lang.Integer y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |