Package com.coyotegulch.jisp
Class KeyObject
java.lang.Object
com.coyotegulch.jisp.KeyObject
- All Implemented Interfaces:
Externalizable,Serializable
KeyObject defines an characteristics of an object to be used as a key * in an ObjectIndex. Since Java lacks true generic types, it is up to * the programmer to ensure that all KeyObjects have the same concrete type * for a given ObjectIndex. Each ObjectIndex supports a single * concrete KeyObject type. * * Concrete KeyObject classes must always produce a
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intReturned bycompareTowhen the invoking key is greater than the parameter key.static final intReturned bycompareTowhen the invoking key has a different type from the parameter key.static final intReturned bycompareTowhen the invoking key is less than the parameter key.static final intReturned bycompareTowhen the invoking key equals the parameter key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intCompares the invoking object tokey, returning one of theKEY_*constants based on the relationship of the two keys.abstract KeyObjectReturns a "null" (i.e., blank) key, to be used as a space-holder in certain kinds ofObjectIndexes.toString()Returns theStringrepresentation of aKeyObject.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
Field Details
-
KEY_LESS
public static final int KEY_LESSReturned bycompareTowhen the invoking key is less than the parameter key.- See Also:
-
KEY_EQUAL
public static final int KEY_EQUALReturned bycompareTowhen the invoking key is greater than the parameter key.- See Also:
-
KEY_MORE
public static final int KEY_MOREReturned bycompareTowhen the invoking key equals the parameter key.- See Also:
-
KEY_ERROR
public static final int KEY_ERRORReturned bycompareTowhen the invoking key has a different type from the parameter key.- See Also:
-
-
Constructor Details
-
KeyObject
public KeyObject()
-
-
Method Details
-
compareTo
Compares the invoking object tokey, returning one of theKEY_*constants based on the relationship of the two keys.- Parameters:
key- The key value to be compared against the invoking key. * @return One of theKEY_*constants based on the relationship of the two keys.
-
makeNullKey
Returns a "null" (i.e., blank) key, to be used as a space-holder in certain kinds ofObjectIndexes.For example, a
BTreeIndexmaintains a set of index pages that must contain a set number of fixed-length keys. When creating aBTreeIndex, you must provide a "null" key, using themakeNullKeymethod.- Returns:
- A "null" (i.e., blank) key constant.
- See Also:
-
toString
Returns theStringrepresentation of aKeyObject.
-