JML

org.jmlspecs.models
Class JMLPositiveInfinity

java.lang.Object
  extended byorg.jmlspecs.models.JMLInfiniteIntegerClass
      extended byorg.jmlspecs.models.JMLPositiveInfinity
All Implemented Interfaces:
Cloneable, Comparable, JMLComparable, JMLInfiniteInteger, JMLType, Serializable

public class JMLPositiveInfinity
extends JMLInfiniteIntegerClass

Positive Infinity.

Version:
$Revision: 1.15 $
Author:
Gary T. Leavens
See Also:
JMLNegativeInfinity

Constructor Summary
JMLPositiveInfinity()
          Initialize this object.
 
Method Summary
 JMLInfiniteInteger add(JMLInfiniteInteger n)
          Return the sum of this integer and the argument.
 int compareTo(Object o)
          Compare this to o, returning a comparison code.
 int compareTo(JMLInfiniteInteger n)
          Compare this to the given integer, returning a comparison code.
 JMLInfiniteInteger divide(JMLInfiniteInteger n)
          Return the quotient of this integer divided by the argument.
 double doubleValue()
          Return this integer approximated by a double.
 BigInteger finiteValue()
          Throw an ArithmeticException.
 float floatValue()
          Return this integer approximated by a float.
 int hashCode()
          Return a hash code for this object.
 boolean isFinite()
          Return false.
 JMLInfiniteInteger mod(JMLInfiniteInteger n)
          Return this integer modulo the argument.
 JMLInfiniteInteger multiply(JMLInfiniteInteger n)
          Return the product of this integer and the argument.
 JMLInfiniteInteger negate()
          Return negative infinity.
 JMLInfiniteInteger pow(int n)
          Return this integer raised to the argument's power.
 JMLInfiniteInteger remainder(JMLInfiniteInteger n)
          Return the remainder of this integer divided by the argument.
 int signum()
          Return the sign of this integer.
 JMLInfiniteInteger subtract(JMLInfiniteInteger n)
          Return the difference between this integer and the argument.
 String toString()
          Return the string "Infinity".
 String toString(int radix)
          Return the string "Infinity".
 
Methods inherited from class org.jmlspecs.models.JMLInfiniteIntegerClass
abs, clone, equals, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo, max, min
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JMLPositiveInfinity

public JMLPositiveInfinity()
Initialize this object.

Method Detail

signum

public int signum()
Return the sign of this integer.


isFinite

public boolean isFinite()
Return false.


finiteValue

public BigInteger finiteValue()
                       throws ArithmeticException
Throw an ArithmeticException.

Throws:
ArithmeticException

compareTo

public int compareTo(JMLInfiniteInteger n)
Compare this to the given integer, returning a comparison code.


compareTo

public int compareTo(Object o)
              throws ClassCastException
Compare this to o, returning a comparison code.

Parameters:
o - the object this is compared to.
Throws:
ClassCastException - when o is not a JMLInfiniteInteger or a BigInteger.
See Also:
JMLInfiniteInteger.equals(Object), JMLInfiniteInteger.greaterThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.greaterThan(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThan(org.jmlspecs.models.JMLInfiniteInteger)

hashCode

public int hashCode()
Return a hash code for this object.

Specified by:
hashCode in interface JMLInfiniteInteger
Overrides:
hashCode in class Object

negate

public JMLInfiniteInteger negate()
Return negative infinity.

See Also:
JMLInfiniteInteger.abs(), JMLInfiniteInteger.subtract(org.jmlspecs.models.JMLInfiniteInteger)

add

public JMLInfiniteInteger add(JMLInfiniteInteger n)
Return the sum of this integer and the argument.

See Also:
JMLInfiniteInteger.subtract(org.jmlspecs.models.JMLInfiniteInteger)

subtract

public JMLInfiniteInteger subtract(JMLInfiniteInteger n)
Return the difference between this integer and the argument.

See Also:
JMLInfiniteInteger.add(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.negate()

multiply

public JMLInfiniteInteger multiply(JMLInfiniteInteger n)
Return the product of this integer and the argument.

See Also:
JMLInfiniteInteger.divide(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.remainder(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.mod(org.jmlspecs.models.JMLInfiniteInteger)

divide

public JMLInfiniteInteger divide(JMLInfiniteInteger n)
                          throws ArithmeticException
Return the quotient of this integer divided by the argument.

Throws:
ArithmeticException
See Also:
JMLInfiniteInteger.multiply(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.remainder(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.mod(org.jmlspecs.models.JMLInfiniteInteger)

remainder

public JMLInfiniteInteger remainder(JMLInfiniteInteger n)
                             throws ArithmeticException
Return the remainder of this integer divided by the argument.

Throws:
ArithmeticException
See Also:
JMLInfiniteInteger.divide(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.mod(org.jmlspecs.models.JMLInfiniteInteger)

mod

public JMLInfiniteInteger mod(JMLInfiniteInteger n)
                       throws ArithmeticException
Return this integer modulo the argument.

Throws:
ArithmeticException
See Also:
JMLInfiniteInteger.divide(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.remainder(org.jmlspecs.models.JMLInfiniteInteger)

pow

public JMLInfiniteInteger pow(int n)
                       throws ArithmeticException
Return this integer raised to the argument's power.

Throws:
ArithmeticException

doubleValue

public double doubleValue()
Return this integer approximated by a double.

See Also:
JMLInfiniteInteger.floatValue()

floatValue

public float floatValue()
Return this integer approximated by a float.

See Also:
JMLInfiniteInteger.doubleValue()

toString

public String toString()
Return the string "Infinity".

Specified by:
toString in interface JMLInfiniteInteger
Overrides:
toString in class Object
See Also:
JMLInfiniteInteger.toString(int)

toString

public String toString(int radix)
Return the string "Infinity".

See Also:
JMLInfiniteInteger.toString()

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.