|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectglobal.SearchKey
public class SearchKey
Provides a general and type-safe way to store and compare index search keys.
Constructor Summary | |
---|---|
SearchKey(byte[] data,
short offset)
Constructs a SearchKey stored in the given data buffer. |
|
SearchKey(java.lang.Float value)
Constructs a new float search key. |
|
SearchKey(java.lang.Integer value)
Constructs a new integer search key. |
|
SearchKey(java.lang.Object value)
Constructs a search key from a generic value. |
|
SearchKey(SearchKey key)
Copy constructor for a search key. |
|
SearchKey(java.lang.String value)
Constructs a new string search key. |
Method Summary | |
---|---|
int |
compareTo(SearchKey key)
Generically compares two search keys. |
boolean |
equals(java.lang.Object obj)
True if obj is a SearchKey with the same values; false otherwise. |
int |
getHash(int depth)
Gets the hash value for the search key, given the depth (i.e. |
short |
getLength()
Gets the total length of the search key (in bytes). |
int |
hashCode()
Returns a generic hash code for the key value. |
boolean |
isHash(int hash)
Returns true if the search key matches the given hash value, false otherwise. |
void |
writeData(byte[] data,
short offset)
Writes the SearchKey into the given data buffer. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SearchKey(java.lang.Integer value)
public SearchKey(java.lang.Float value)
public SearchKey(java.lang.String value)
public SearchKey(java.lang.Object value)
java.lang.IllegalArgumentException
- if value's type is invalidpublic SearchKey(SearchKey key)
public SearchKey(byte[] data, short offset) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void writeData(byte[] data, short offset) throws java.io.IOException
java.io.IOException
public short getLength()
public int getHash(int depth)
public boolean isHash(int hash)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(SearchKey key)
compareTo
in interface java.lang.Comparable<SearchKey>
java.lang.IllegalArgumentException
- if the search keys are not comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |