Class KeyHasher
java.lang.Object
org.apache.derby.iapi.store.access.KeyHasher
Provides the ability to hash on multiple objects.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
buildHashKey
(Object[] objects, int[] indexes) Static method to return the object to hash on.boolean
getObject
(int index) Get the object stored at the specified index.int
hashCode()
void
Set array element at the specified index to the specified object.
-
Field Details
-
objects
-
-
Constructor Details
-
KeyHasher
public KeyHasher(int size)
-
-
Method Details
-
setObject
Set array element at the specified index to the specified object.- Parameters:
index
- The specified indexobject
- The specified object.
-
getObject
Get the object stored at the specified index.- Parameters:
index
- The specified index.- Returns:
- The object stored in the array element.
-
buildHashKey
Static method to return the object to hash on. (Object stored in specifed array, if only a single object, otherwise a KeyHasher wrapping the objects to hash on. (NOTE: We optimize for in-memory hash tables, hence we only create a wrapper when needed.)- Parameters:
objects
- The array of objects to considerindexes
- The indexes of the objects in the hash key.- Returns:
- The object to hash on.
-
hashCode
public int hashCode() -
equals
-