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 KeyObject
s 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 int
Returned bycompareTo
when the invoking key is greater than the parameter key.static final int
Returned bycompareTo
when the invoking key has a different type from the parameter key.static final int
Returned bycompareTo
when the invoking key is less than the parameter key.static final int
Returned bycompareTo
when the invoking key equals the parameter key. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract int
Compares the invoking object tokey
, returning one of theKEY_*
constants based on the relationship of the two keys.abstract KeyObject
Returns a "null" (i.e., blank) key, to be used as a space-holder in certain kinds ofObjectIndexes
.toString()
Returns theString
representation of aKeyObject
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
Field Details
-
KEY_LESS
public static final int KEY_LESSReturned bycompareTo
when the invoking key is less than the parameter key.- See Also:
-
KEY_EQUAL
public static final int KEY_EQUALReturned bycompareTo
when the invoking key is greater than the parameter key.- See Also:
-
KEY_MORE
public static final int KEY_MOREReturned bycompareTo
when the invoking key equals the parameter key.- See Also:
-
KEY_ERROR
public static final int KEY_ERRORReturned bycompareTo
when 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
BTreeIndex
maintains 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 themakeNullKey
method.- Returns:
- A "null" (i.e., blank) key constant.
- See Also:
-
toString
Returns theString
representation of aKeyObject
.
-