com.coyotegulch.jisp

Class StringKey

public class StringKey extends KeyObject

StringKey defines a 16-character fixed-length text key.

See Also: KeyObject ObjectIndex

Field Summary
protected static intKEY_LENGTH
Constructor Summary
StringKey(String key_value)
Creates a new StringKey using key_value.
StringKey()
Creates a blank (null) StringKey.
Method Summary
intcompareTo(KeyObject key)
Compares the invoking StringKey to key, returning one of the KEY_* 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 of ObjectIndexes.
voidreadExternal(ObjectInput in)
StringKey implements the readExternal method to restore its contents.
StringtoString()
Returns the String representation of a StringKey.
voidwriteExternal(ObjectOutput out)
StringKey implements the writeExternal method to save its contents.

Field Detail

KEY_LENGTH

protected static final int KEY_LENGTH

Constructor Detail

StringKey

public StringKey(String key_value)
Creates a new StringKey using key_value.

Parameters: key_value The text of the newly-created key.

StringKey

public StringKey()
Creates a blank (null) StringKey.

Method Detail

compareTo

public int compareTo(KeyObject key)
Compares the invoking StringKey to key, returning one of the KEY_* constants based on the relationship of the two keys.

Parameters: key The StringKey value to be compared against the invoking key.

Returns: one of the KEY_* constants based on the relationship of the two keys.

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.

Returns: hash code value for this object.

See Also: java.lang.Object HashIndex

makeNullKey

public KeyObject makeNullKey()
Returns a "null" (i.e., blank) StringKey, to be used as a space-holder in certain kinds of ObjectIndexes.

Returns: a "null" (i.e., blank) StringKey constant.

readExternal

public void readExternal(ObjectInput in)
StringKey implements the readExternal method to restore its contents.

toString

public String toString()
Returns the String representation of a StringKey.

Returns: String representation of a StringKey.

writeExternal

public void writeExternal(ObjectOutput out)
StringKey implements the writeExternal method to save its contents.