Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Number | +--nl.coffee.math.AbstractRealNumber | +--nl.coffee.math.AbstractRationalNumber | +--nl.coffee.math.AbstractIntegerNumber | +--nl.coffee.math.LongIntegerNumber
IntegerNumber
based on a
long
value.
Instances must be obtained by using one of the
createInstance()
factory methods. Using this approach,
instances can be transparently cached by this class.
Field Summary | |
static LongIntegerNumber | EIGHT
Cached instance that represents the number eight, 8. |
static LongIntegerNumber | FIVE
Cached instance that represents the number five, 5. |
static LongIntegerNumber | FOUR
Cached instance that represents the number four, 4. |
static LongIntegerNumber | MAXIMUM_VALUE
The maximum IntegerNumber that can be represented by this
class. |
static LongIntegerNumber | MINIMUM_VALUE
The minimum IntegerNumber that can be represented by this
class. |
static LongIntegerNumber | MINUS_ONE
Cached instance that represents the number minus one, -1. |
static LongIntegerNumber | MINUS_TWO
Cached instance that represents the number minus two, -2. |
static LongIntegerNumber | NINE
Cached instance that represents the number nine, 9. |
static LongIntegerNumber | ONE
Cached instance that represents the number one, 1. |
static LongIntegerNumber | SEVEN
Cached instance that represents the number seven, 7. |
static LongIntegerNumber | SIX
Cached instance that represents the number six, 6. |
static LongIntegerNumber | TEN
Cached instance that represents the number ten, 10. |
static LongIntegerNumber | THREE
Cached instance that represents the number three, 3. |
static LongIntegerNumber | TWO
Cached instance that represents the number two, 2. |
long | value
The long this IntegerNumber implementation
is based on. |
static LongIntegerNumber | ZERO
Cached instance that represents the number zero, 0. |
Constructor Summary | |
LongIntegerNumber(long n)
Constructs a LongIntegerNumber from a
long . |
Method Summary | |
IntegerNumber | add(IntegerNumber n)
|
static LongIntegerNumber | createInstance(long n)
Returns an instance of a LongIntegerNumber based on a
long value. |
IntegerNumber | dec()
|
double | doubleValue()
|
int | getSign()
|
IntegerNumber | inc()
|
IntegerNumber | integerDivide(IntegerNumber n)
|
long | longValue()
|
IntegerNumber | multiply(IntegerNumber n)
|
RealNumber | negate()
|
IntegerNumber | remainder(IntegerNumber n)
|
java.math.BigInteger | toBigInteger()
|
byte[] | toByteArray()
|
java.lang.String | toString()
|
Methods inherited from class nl.coffee.math.AbstractIntegerNumber | |
add, compareTo, dec, divide, fac, gcd, getDenominator, getNumerator, getSign, hashCode, inc, invert, isRelativePrime, multiply, negate, pow, remainder, subtract, subtract, toBigDecimal, toBigDecimal, toBigDecimal, toBigInteger, toString, trunc |
Methods inherited from class nl.coffee.math.AbstractRationalNumber | |
add, add, compareTo, divide, divide, doubleValue, getSign, invert, multiply, multiply, negate, pow, pow, retryCompare, retryCompare, subtract, subtract, toBigDecimal, toBigDecimal, toString, trunc |
Methods inherited from class nl.coffee.math.AbstractRealNumber | |
abs, add, byteValue, compareTo, divide, doubleValue, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, hashCode, intValue, invert, longValue, multiply, negate, pow, retryCompare, shortValue, subtract, toBigDecimal, toBigInteger |
Methods inherited from class java.lang.Number | |
byteValue, doubleValue, floatValue, intValue, longValue, shortValue |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final LongIntegerNumber MINIMUM_VALUE
IntegerNumber
that can be represented by this
class.public static final LongIntegerNumber MAXIMUM_VALUE
IntegerNumber
that can be represented by this
class.public static final LongIntegerNumber MINUS_TWO
public static final LongIntegerNumber MINUS_ONE
public static final LongIntegerNumber ZERO
public static final LongIntegerNumber ONE
public static final LongIntegerNumber TWO
public static final LongIntegerNumber THREE
public static final LongIntegerNumber FOUR
public static final LongIntegerNumber FIVE
public static final LongIntegerNumber SIX
public static final LongIntegerNumber SEVEN
public static final LongIntegerNumber EIGHT
public static final LongIntegerNumber NINE
public static final LongIntegerNumber TEN
public final long value
long
this IntegerNumber
implementation
is based on.Constructor Detail |
protected LongIntegerNumber(long n)
LongIntegerNumber
from a
long
.
n
- the value for the new number.Method Detail |
public static LongIntegerNumber createInstance(long n)
LongIntegerNumber
based on a
long
value.
n
- the long number to construct a
LongIntegerNumber
from.LongIntegerNumber
.public int getSign()
public RealNumber negate()
public IntegerNumber add(IntegerNumber n) throws java.lang.IllegalArgumentException
public IntegerNumber multiply(IntegerNumber n) throws java.lang.IllegalArgumentException
public IntegerNumber dec()
public IntegerNumber inc()
public IntegerNumber integerDivide(IntegerNumber n) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
public IntegerNumber remainder(IntegerNumber n) throws java.lang.ArithmeticException, java.lang.IllegalArgumentException
public long longValue()
public double doubleValue()
public byte[] toByteArray()
public java.math.BigInteger toBigInteger()
public java.lang.String toString()
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |