JML

org.jmlspecs.models
Class JMLInfiniteIntegerClass

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

public abstract class JMLInfiniteIntegerClass
extends Object
implements JMLInfiniteInteger

Class with common code to implement JMLInfiniteInteger.

Version:
$Revision: 1.11 $
Author:
Gary T. Leavens
See Also:
BigInteger

Constructor Summary
JMLInfiniteIntegerClass()
           
 
Method Summary
 JMLInfiniteInteger abs()
          Return the absolute value of this integer.
 Object clone()
          Return a clone of this integer.
abstract  int compareTo(JMLInfiniteInteger n)
          Compare this to n, returning a comparison code.
 boolean equals(Object o)
          Tell whether this integer is equal to the argument.
 boolean greaterThan(JMLInfiniteInteger n)
          Tell if this integer is strictly greater than the argument.
 boolean greaterThanOrEqualTo(JMLInfiniteInteger n)
          Tell if this integer is greater than or equal to the argument.
 boolean lessThan(JMLInfiniteInteger n)
          Tell if this integer is strictly less than the argument.
 boolean lessThanOrEqualTo(JMLInfiniteInteger n)
          Tell if this integer is less than or equal to the argument.
 JMLInfiniteInteger max(JMLInfiniteInteger n)
          Return the maximum of this integer and the argument.
 JMLInfiniteInteger min(JMLInfiniteInteger n)
          Return the minimum of this integer and the argument.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jmlspecs.models.JMLInfiniteInteger
add, compareTo, divide, doubleValue, finiteValue, floatValue, hashCode, isFinite, mod, multiply, negate, pow, remainder, signum, subtract, toString, toString
 

Constructor Detail

JMLInfiniteIntegerClass

public JMLInfiniteIntegerClass()
Method Detail

clone

public Object clone()
Return a clone of this integer.

Specified by:
clone in interface JMLType
Overrides:
clone in class Object

equals

public boolean equals(Object o)
Tell whether this integer is equal to the argument. Note that comparisons to BigIntegers are also handled.

Specified by:
equals in interface JMLInfiniteInteger
Overrides:
equals in class Object
See Also:
JMLInfiniteInteger.compareTo(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)

compareTo

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

Parameters:
n - the object this is compared to.

greaterThanOrEqualTo

public boolean greaterThanOrEqualTo(JMLInfiniteInteger n)
Tell if this integer is greater than or equal to the argument.

Specified by:
greaterThanOrEqualTo in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.equals(Object), JMLInfiniteInteger.compareTo(Object), JMLInfiniteInteger.greaterThan(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThan(org.jmlspecs.models.JMLInfiniteInteger)

lessThanOrEqualTo

public boolean lessThanOrEqualTo(JMLInfiniteInteger n)
Tell if this integer is less than or equal to the argument.

Specified by:
lessThanOrEqualTo in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.equals(Object), JMLInfiniteInteger.compareTo(Object), JMLInfiniteInteger.greaterThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.greaterThan(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThan(org.jmlspecs.models.JMLInfiniteInteger)

greaterThan

public boolean greaterThan(JMLInfiniteInteger n)
Tell if this integer is strictly greater than the argument.

Specified by:
greaterThan in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.equals(Object), JMLInfiniteInteger.compareTo(Object), JMLInfiniteInteger.greaterThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThan(org.jmlspecs.models.JMLInfiniteInteger)

lessThan

public boolean lessThan(JMLInfiniteInteger n)
Tell if this integer is strictly less than the argument.

Specified by:
lessThan in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.equals(Object), JMLInfiniteInteger.compareTo(Object), JMLInfiniteInteger.greaterThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.greaterThan(org.jmlspecs.models.JMLInfiniteInteger), JMLInfiniteInteger.lessThanOrEqualTo(org.jmlspecs.models.JMLInfiniteInteger)

abs

public JMLInfiniteInteger abs()
Return the absolute value of this integer.

Specified by:
abs in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.negate()

max

public JMLInfiniteInteger max(JMLInfiniteInteger n)
Return the maximum of this integer and the argument.

Specified by:
max in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.min(org.jmlspecs.models.JMLInfiniteInteger)

min

public JMLInfiniteInteger min(JMLInfiniteInteger n)
Description copied from interface: JMLInfiniteInteger
Return the minimum of this integer and the argument.

Specified by:
min in interface JMLInfiniteInteger
See Also:
JMLInfiniteInteger.max(org.jmlspecs.models.JMLInfiniteInteger)

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.