org.apache.derby.iapi.store.access
Class KeyHasher
java.lang.Object
org.apache.derby.iapi.store.access.KeyHasher
- public class KeyHasher
- extends java.lang.Object
Provides the ability to hash on multiple objects.
Field Summary |
private java.lang.Object[] |
objects
|
Method Summary |
static java.lang.Object |
buildHashKey(java.lang.Object[] objects,
int[] indexes)
Static method to return the object to hash on.
|
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
getObject(int index)
Get the object stored at the specified index. |
int |
hashCode()
|
void |
setObject(int index,
java.lang.Object object)
Set array element at the specified index to the specified object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
objects
private final java.lang.Object[] objects
KeyHasher
public KeyHasher(int size)
setObject
public void setObject(int index,
java.lang.Object object)
- Set array element at the specified index to the specified object.
- Parameters:
index
- The specified indexobject
- The specified object.
- Returns:
- Nothing.
getObject
public java.lang.Object getObject(int index)
- Get the object stored at the specified index.
- Parameters:
index
- The specified index.
- Returns:
- The object stored in the array element.
buildHashKey
public static java.lang.Object buildHashKey(java.lang.Object[] objects,
int[] indexes)
- 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
public boolean equals(java.lang.Object obj)
Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.