org.jscience.mathematics.algebraic.numbers
Class ComparableNumber<T extends ComparableNumber>

java.lang.Object
  extended by java.lang.Number
      extended by org.jscience.mathematics.algebraic.numbers.ComparableNumber<T>
Type Parameters:
T - DOCUMENT ME!
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<T>
Direct Known Subclasses:
Boolean, Double, ExactInteger, ExactRational, ExactReal, Float, Integer, Long, Rational

public abstract class ComparableNumber<T extends ComparableNumber>
extends java.lang.Number
implements java.lang.Comparable<T>

This is the superclass for comparable numbers.

See Also:
Serialized Form

Constructor Summary
ComparableNumber()
           
 
Method Summary
abstract  T getDistance(ComparableNumber n)
          DOCUMENT ME!
abstract  T getNaN()
          DOCUMENT ME!
abstract  T getNegativeInfinity()
          DOCUMENT ME!
abstract  T getPositiveInfinity()
          DOCUMENT ME!
abstract  boolean isInfinite()
          Returns true if this number is infinite.
abstract  boolean isNaN()
          Returns true if this number is NaN.
abstract  boolean isNegativeInfinity()
          DOCUMENT ME!
abstract  boolean isPositiveInfinity()
          DOCUMENT ME!
 T max(T val)
          Returns the max of this number and another, according to compareTo rules.
 T min(T val)
          Returns the min of this number and another, according to compareTo rules.
 
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, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ComparableNumber

public ComparableNumber()
Method Detail

getDistance

public abstract T getDistance(ComparableNumber n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

isNaN

public abstract boolean isNaN()
Returns true if this number is NaN.

Returns:
DOCUMENT ME!

getNaN

public abstract T getNaN()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isInfinite

public abstract boolean isInfinite()
Returns true if this number is infinite.

Returns:
DOCUMENT ME!

isPositiveInfinity

public abstract boolean isPositiveInfinity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPositiveInfinity

public abstract T getPositiveInfinity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

isNegativeInfinity

public abstract boolean isNegativeInfinity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getNegativeInfinity

public abstract T getNegativeInfinity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

min

public T min(T val)
Returns the min of this number and another, according to compareTo rules.

Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!

max

public T max(T val)
Returns the max of this number and another, according to compareTo rules.

Parameters:
val - DOCUMENT ME!
Returns:
DOCUMENT ME!