Opus5
Class Int

java.lang.Object
  |
  +--Opus5.AbstractObject
        |
        +--Opus5.Int
All Implemented Interfaces:
Comparable

public class Int
extends AbstractObject

Wrapper class that wraps an int and implements the Comparable interface.

Version:
$Id: Int.java,v 3.2 1998/07/28 12:02:38 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.
See Also:
Comparable

Field Summary
protected  int value
          The wrapped int.
 
Fields inherited from interface Opus5.Comparable
copyright
 
Constructor Summary
Int(int value)
          Constructs an Int with the specified value.
 
Method Summary
protected  int compareTo(Comparable object)
          Compares this Int with the specified comparable object.
 int hashCode()
          Returns the hashcode for this Int.
 int intValue()
          Returns the value of this Int.
 java.lang.String toString()
          Returns a string representation of this Int.
 
Methods inherited from class Opus5.AbstractObject
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected int value
The wrapped int.
Constructor Detail

Int

public Int(int value)
Constructs an Int with the specified value.
Parameters:
value - The specified value.
Method Detail

intValue

public int intValue()
Returns the value of this Int.
Returns:
the value of this Int.

compareTo

protected int compareTo(Comparable object)
Compares this Int with the specified comparable object. The specified comparable object is assumed to be an Int instance.
Overrides:
compareTo in class AbstractObject
Parameters:
object - The object with which this object is compared.
Returns:
-1 if this object is less than the specified object; +1 if this object is greater than the specified object; zero if the two objects are equal.

hashCode

public int hashCode()
Returns the hashcode for this Int.
Overrides:
hashCode in class java.lang.Object
Returns:
The value of this Int.

toString

public java.lang.String toString()
Returns a string representation of this Int.
Overrides:
toString in class java.lang.Object
Returns:
A string representation of this Int.