Class LongKey

java.lang.Object
com.coyotegulch.jisp.KeyObject
com.coyotegulch.jisp.LongKey
All Implemented Interfaces:
Externalizable, Serializable

public class LongKey extends KeyObject
LongKey defines a key based on the long type.
See Also:
  • Field Summary

    Fields inherited from class com.coyotegulch.jisp.KeyObject

    KEY_EQUAL, KEY_ERROR, KEY_LESS, KEY_MORE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a blank LongKey (value = 0).
    LongKey(long key_value)
    Creates a new LongKey with a specific value.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares the invoking LongKey to key, returning one of the KEY_* constants based on the relationship of the two keys.
    int
    Returns a hash code value for the object, which is, in effect, the the value of the key.
    long
    Returns the long value of a LongKey.
    Returns a "null" (i.e., blank) LongKey, to be used as a space-holder in certain kinds of ObjectIndexes.
    void
    LongKey implements the readExternal method to restore its contents.
    Returns the String representation of a LongKey.
    void
    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 Details

    • LongKey

      public LongKey(long key_value)
      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 Details

    • compareTo

      public int compareTo(KeyObject 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 KeyObject
      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.
    • makeNullKey

      public KeyObject makeNullKey()
      Returns a "null" (i.e., blank) LongKey, to be used as a space-holder in certain kinds of ObjectIndexes. The "null" value is 0xFFFFFFFFFFFFFFFF (all ones).
      Specified by:
      makeNullKey in class KeyObject
      Returns:
      A "null" (i.e., blank) LongKey constant.
      See Also:
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      LongKey implements the writeExternal method to save its contents.
      Throws:
      IOException
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      LongKey implements the readExternal method to restore its contents.
      Throws:
      IOException
      ClassNotFoundException
    • longValue

      public long longValue()
      Returns the long value of a LongKey.
      Returns:
      The long value of a LongKey.
    • toString

      public String toString()
      Returns the String representation of a LongKey.
      Overrides:
      toString in class KeyObject
      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.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
      See Also: