org.apache.derby.iapi.store.access
Class KeyHasher

java.lang.Object
  extended byorg.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
           
 
Constructor Summary
KeyHasher(int size)
           
 
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
 

Field Detail

objects

private final java.lang.Object[] objects
Constructor Detail

KeyHasher

public KeyHasher(int size)
Method Detail

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 index
object - 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 consider
indexes - 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)

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.