Package com.coyotegulch.jisp
Class StringKey
- java.lang.Object
-
- com.coyotegulch.jisp.KeyObject
-
- com.coyotegulch.jisp.StringKey
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class StringKey extends KeyObject
StringKeydefines a 16-character fixed-length text key.- See Also:
KeyObject,ObjectIndex, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(KeyObject key)Compares the invokingStringKeytokey, returning one of theKEY_*constants based on the relationship of the two keys.inthashCode()Returns a hash code value for the object, which is, in effect, the the sum of the characters in the string key value.KeyObjectmakeNullKey()Returns a "null" (i.e., blank)StringKey, to be used as a space-holder in certain kinds ofObjectIndexes.voidreadExternal(java.io.ObjectInput in)StringKeyimplements the readExternal method to restore its contents.java.lang.StringtoString()Returns theStringrepresentation of aStringKey.voidwriteExternal(java.io.ObjectOutput out)StringKeyimplements thewriteExternalmethod to save its contents.
-
-
-
Field Detail
-
KEY_LENGTH
protected static final int KEY_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
compareTo
public int compareTo(KeyObject key)
Compares the invokingStringKeytokey, returning one of theKEY_*constants based on the relationship of the two keys.
-
makeNullKey
public KeyObject makeNullKey()
Returns a "null" (i.e., blank)StringKey, to be used as a space-holder in certain kinds ofObjectIndexes.- Specified by:
makeNullKeyin classKeyObject- Returns:
- a "null" (i.e., blank)
StringKeyconstant. - See Also:
BTreeIndex
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionStringKeyimplements thewriteExternalmethod to save its contents.- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionStringKeyimplements the readExternal method to restore its contents.- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
toString
public java.lang.String toString()
Returns theStringrepresentation of aStringKey.
-
hashCode
public int hashCode()
Returns a hash code value for the object, which is, in effect, the the sum of the characters in the string key value.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code value for this object.
- See Also:
Object,HashIndex
-
-