Project Wonder 2.0

er.extensions
Class ERXMultiKey

java.lang.Object
  extended byer.extensions.ERXMultiKey

public class ERXMultiKey
extends Object

Simple class to use multiple objects as a single key for a dictionary or HashMap. The goal of this class is to be very fast.


Constructor Summary
ERXMultiKey()
          Constructs a multi-key.
ERXMultiKey(NSArray keys)
          Constructs a multi-key for a given array.
ERXMultiKey(Object[] keys)
          Constructs a multi-key for a given object array.
ERXMultiKey(short keyCount)
          Constructs a multi-key for a given number.
ERXMultiKey(Vector keys)
          Constructs a multi-key for a given vector.
 
Method Summary
 boolean equals(Object o)
          Method used to compare two ERXMultiKeys.
 int hashCode()
          Calculates a unique hash code for the given array of keys.
 Object[] keys()
          Method used to return the object array of keys for the current multi-key.
 String toString()
          String representation of the multi-key.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERXMultiKey

public ERXMultiKey(short keyCount)
Constructs a multi-key for a given number.

Parameters:
keyCount - number of keys

ERXMultiKey

public ERXMultiKey()
Constructs a multi-key.


ERXMultiKey

public ERXMultiKey(Object[] keys)
Constructs a multi-key for a given object array.

Parameters:
keys - object array

ERXMultiKey

public ERXMultiKey(NSArray keys)
Constructs a multi-key for a given array.

Parameters:
keys - array of keys

ERXMultiKey

public ERXMultiKey(Vector keys)
Constructs a multi-key for a given vector.

Parameters:
keys - vector of keys
Method Detail

keys

public final Object[] keys()
Method used to return the object array of keys for the current multi-key.

Returns:
object array of keys

hashCode

public final int hashCode()
Calculates a unique hash code for the given array of keys.

Returns:
unique hash code for the array of keys.

equals

public final boolean equals(Object o)
Method used to compare two ERXMultiKeys. A multi key is equal to another multi key if the number of keys are equal and all of the keys are either both null or equals.

Parameters:
o - object to be compared
Returns:
result of comparison

toString

public String toString()
String representation of the multi-key.

Returns:
string representation of key.

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.