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 TypeMethodDescriptionint
Compares the invokingStringKey
tokey
, returning one of theKEY_*
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 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
.void
StringKey
implements the readExternal method to restore its contents.toString()
Returns theString
representation of aStringKey
.void
StringKey
implements thewriteExternal
method to save its contents.
-
Field Details
-
KEY_LENGTH
protected static final int KEY_LENGTH- See Also:
-
-
Constructor Details
-
StringKey
Creates a newStringKey
usingkey_value
.- Parameters:
key_value
- The text of the newly-created key.
-
StringKey
public StringKey()Creates a blank (null)StringKey
.
-
-
Method Details
-
compareTo
Compares the invokingStringKey
tokey
, 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:
makeNullKey
in classKeyObject
- Returns:
- a "null" (i.e., blank)
StringKey
constant. - See Also:
-
writeExternal
StringKey
implements thewriteExternal
method to save its contents.- Throws:
IOException
-
readExternal
StringKey
implements the readExternal method to restore its contents.- Throws:
IOException
ClassNotFoundException
-
toString
Returns theString
representation 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.
-