Package com.coyotegulch.jisp
Class StringKey
java.lang.Object
com.coyotegulch.jisp.KeyObject
com.coyotegulch.jisp.StringKey
- All Implemented Interfaces:
Externalizable,Serializable
StringKey defines a 16-character fixed-length text key.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares 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.Returns a "null" (i.e., blank)StringKey, to be used as a space-holder in certain kinds ofObjectIndexes.voidStringKeyimplements the readExternal method to restore its contents.toString()Returns theStringrepresentation of aStringKey.voidStringKeyimplements thewriteExternalmethod to save its contents.
-
Field Details
-
KEY_LENGTH
protected static final int KEY_LENGTH- See Also:
-
-
Constructor Details
-
StringKey
Creates a newStringKeyusingkey_value.- Parameters:
key_value- The text of the newly-created key.
-
StringKey
public StringKey()Creates a blank (null)StringKey.
-
-
Method Details
-
compareTo
Compares the invokingStringKeytokey, returning one of theKEY_*constants based on the relationship of the two keys. -
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:
-
writeExternal
StringKeyimplements thewriteExternalmethod to save its contents.- Throws:
IOException
-
readExternal
StringKeyimplements the readExternal method to restore its contents.- Throws:
IOExceptionClassNotFoundException
-
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.
-