com.coyotegulch.jisp
Class LongKey

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

public class LongKey
extends OrderedObject

LongKey defines a key based on the long 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
LongKey()
          Creates a blank LongKey (value = 0).
LongKey(long keyValue)
          Creates a new LongKey with a specific value.
 
Method Summary
 int compareTo(OrderedObject key)
          Compares the invoking LongKey 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.
 long longValue()
          Returns the long value of a LongKey.
 void readExternal(java.io.ObjectInput in)
          LongKey implements the readExternal method to restore its contents.
 java.lang.String toString()
          Returns the String representation of a LongKey.
 void writeExternal(java.io.ObjectOutput out)
          LongKey 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

LongKey

public LongKey(long keyValue)
Creates a new LongKey with a specific value.

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

LongKey

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

Method Detail

compareTo

public int compareTo(OrderedObject key)
Compares the invoking LongKey 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 LongKey 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
LongKey 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
LongKey implements the readExternal method to restore its contents.

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

longValue

public long longValue()
Returns the long value of a LongKey.

Returns:
The long value of a LongKey.

toString

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

Returns:
The String representation of a LongKey.

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