com.coyotegulch.jisp
Class IntKey

java.lang.Object
  extended bycom.coyotegulch.jisp.OrderedObject
      extended bycom.coyotegulch.jisp.IntKey
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class IntKey
extends OrderedObject

IntKey defines a key based on the Int type.

See Also:
OrderedObject, ObjectIndex, Serialized Form

Field Summary
 
Fields inherited from class com.coyotegulch.jisp.OrderedObject
KEY_EQUAL, KEY_ERROR, KEY_LESS, KEY_MORE
 
Constructor Summary
IntKey()
          Creates a blank IntKey (value = 0).
IntKey(int keyValue)
          Creates a new IntKey with a specific value.
 
Method Summary
 int compareTo(OrderedObject key)
          Compares the invoking IntKey to key, returning one of the KEY_* constants based on the relationship of the two keys.
 int hashCode()
          Returns a hash code value for the object, which is, in effect, the the value of the key.
 int intValue()
          Returns the int value of a IntKey.
 void readExternal(java.io.ObjectInput in)
          IntKey implements the readExternal method to restore its contents.
 java.lang.String toString()
          Returns the String representation of a IntKey.
 void writeExternal(java.io.ObjectOutput out)
          IntKey implements the writeExternal method to save its contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntKey

public IntKey(int keyValue)
Creates a new IntKey with a specific value.

Parameters:
keyValue - value of the newly-created key.

IntKey

public IntKey()
Creates a blank IntKey (value = 0).

Method Detail

compareTo

public int compareTo(OrderedObject key)
Compares the invoking IntKey to key, returning one of the KEY_* constants based on the relationship of the two keys.

Specified by:
compareTo in class OrderedObject
Parameters:
key - The IntKey value to be compared against the invoking key.
Returns:
One of the KEY_* constants based on the relationship of the two keys.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
IntKey implements the writeExternal method to save its contents.

Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
IntKey implements the readExternal method to restore its contents.

Throws:
java.io.IOException
java.lang.ClassNotFoundException

intValue

public int intValue()
Returns the int value of a IntKey.

Returns:
The int value of a IntKey.

toString

public java.lang.String toString()
Returns the String representation of a IntKey.

Returns:
The String representation of a IntKey.

hashCode

public int hashCode()
Returns a hash code value for the object, which is, in effect, the the value of the key.

Returns:
a hash code value for this object.
See Also:
Object