Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class nl.coffee.math.LongIntegerNumber

java.lang.Object
  |
  +--java.lang.Number
        |
        +--nl.coffee.math.AbstractRealNumber
              |
              +--nl.coffee.math.AbstractRationalNumber
                    |
                    +--nl.coffee.math.AbstractIntegerNumber
                          |
                          +--nl.coffee.math.LongIntegerNumber

public class LongIntegerNumber
extends AbstractIntegerNumber
Implementation of an 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.

Since:
JUMP_1.0
Version:
1.1 199809.24
Author:
Ernst de Haan
See Also:
Serialized Form

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

MINIMUM_VALUE

public static final LongIntegerNumber MINIMUM_VALUE
The minimum IntegerNumber that can be represented by this class.

MAXIMUM_VALUE

public static final LongIntegerNumber MAXIMUM_VALUE
The maximum IntegerNumber that can be represented by this class.

MINUS_TWO

public static final LongIntegerNumber MINUS_TWO
Cached instance that represents the number minus two, -2.

MINUS_ONE

public static final LongIntegerNumber MINUS_ONE
Cached instance that represents the number minus one, -1.

ZERO

public static final LongIntegerNumber ZERO
Cached instance that represents the number zero, 0.

ONE

public static final LongIntegerNumber ONE
Cached instance that represents the number one, 1.

TWO

public static final LongIntegerNumber TWO
Cached instance that represents the number two, 2.

THREE

public static final LongIntegerNumber THREE
Cached instance that represents the number three, 3.

FOUR

public static final LongIntegerNumber FOUR
Cached instance that represents the number four, 4.

FIVE

public static final LongIntegerNumber FIVE
Cached instance that represents the number five, 5.

SIX

public static final LongIntegerNumber SIX
Cached instance that represents the number six, 6.

SEVEN

public static final LongIntegerNumber SEVEN
Cached instance that represents the number seven, 7.

EIGHT

public static final LongIntegerNumber EIGHT
Cached instance that represents the number eight, 8.

NINE

public static final LongIntegerNumber NINE
Cached instance that represents the number nine, 9.

TEN

public static final LongIntegerNumber TEN
Cached instance that represents the number ten, 10.

value

public final long value
The long this IntegerNumber implementation is based on.
Constructor Detail

LongIntegerNumber

protected LongIntegerNumber(long n)
Constructs a LongIntegerNumber from a long.
Parameters:
n - the value for the new number.
Method Detail

createInstance

public static LongIntegerNumber createInstance(long n)
Returns an instance of a LongIntegerNumber based on a long value.
Parameters:
n - the long number to construct a LongIntegerNumber from.
Returns:
the (possibly newly constructed) LongIntegerNumber.

getSign

public int getSign()
Overrides:
getSign in class AbstractIntegerNumber

negate

public RealNumber negate()
Overrides:
negate in class AbstractIntegerNumber

add

public IntegerNumber add(IntegerNumber n)
                                throws java.lang.IllegalArgumentException

multiply

public IntegerNumber multiply(IntegerNumber n)
                                     throws java.lang.IllegalArgumentException

dec

public IntegerNumber dec()
Overrides:
dec in class AbstractIntegerNumber

inc

public IntegerNumber inc()
Overrides:
inc in class AbstractIntegerNumber

integerDivide

public IntegerNumber integerDivide(IntegerNumber n)
                                          throws java.lang.ArithmeticException,
                                                 java.lang.IllegalArgumentException

remainder

public IntegerNumber remainder(IntegerNumber n)
                                      throws java.lang.ArithmeticException,
                                             java.lang.IllegalArgumentException
Overrides:
remainder in class AbstractIntegerNumber

longValue

public long longValue()
Overrides:
longValue in class AbstractRealNumber

doubleValue

public double doubleValue()
Overrides:
doubleValue in class AbstractRationalNumber

toByteArray

public byte[] toByteArray()

toBigInteger

public java.math.BigInteger toBigInteger()
Overrides:
toBigInteger in class AbstractIntegerNumber

toString

public java.lang.String toString()
Overrides:
toString in class AbstractIntegerNumber

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD