|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectariba.util.core.MultiKeyHashtable
public class MultiKeyHashtable
A MultiKeyHashtable class that allows for multiple keys per entry. This is useful when several keys are required to uniquely identify an object. For example, to uniquely identify a Method, we must have the Class and the name of the Method. Note that this class is not thread-safe. This does NOT currently support removing values.
| Constructor Summary | |
|---|---|
MultiKeyHashtable(int keyCount)
Constructs a new, empty MultiKeyHashtable which uses the specified number of keys. |
|
MultiKeyHashtable(int keyCount,
int initialSize,
boolean useIdentityComparison)
Constructs a new, empty MultiKeyHashtable which uses the specified number of keys, initial size, and whether or not comparisons use the 'equals' method or simply '=='. |
|
| Method Summary | |
|---|---|
void |
add(MultiKeyHashtable otherHashtable)
Adds all the items from otherHashtable to the reciever. |
Object |
clone()
Creates a copy of the receiver including a copy of the internal keys and values arrays. |
Object |
get(Object key0,
Object key1)
Locates and returns the value keyed by the two keys key0, key1. |
Object |
get(Object key0,
Object key1,
Object key2)
Locates and returns the value keyed by the three keys key0, key1, key2. |
Object |
get(Object key0,
Object key1,
Object key2,
Object key3)
Locates and returns the value keyed by the fours keys key0, key1, key2, key3. |
int |
keyCount()
The number of keys expected by the table. |
Object |
put(Object key0,
Object key1,
Object value)
Inserts the value keyed by the two keys key0, key1. |
Object |
put(Object key0,
Object key1,
Object key2,
Object value)
Inserts the value keyed by the three keys key0, key1, key2. |
Object |
put(Object key0,
Object key1,
Object key2,
Object key3,
Object value)
Inserts the value keyed by the four keys key0, key1, key2, key3. |
Object |
putIfAbsent(Object key0,
Object key1,
Object value)
See put(..). |
Object |
putIfAbsent(Object key0,
Object key1,
Object key2,
Object value)
See put(..). |
Object |
putIfAbsent(Object key0,
Object key1,
Object key2,
Object key3,
Object value)
See put(..). |
Object |
remove(Object[] targetKeyList)
Removes from the table the object value for a list of target keys. |
int |
size()
The current size (or number of entries) in the table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiKeyHashtable(int keyCount)
keyCount - the number of keys which the table will use.
All gets and puts must use this number of keys to access the table.
public MultiKeyHashtable(int keyCount,
int initialSize,
boolean useIdentityComparison)
keyCount - the number of keys which the table will use. All gets
and puts must use this number of keys to access the table.initialSize - the number of slots created when the hashtable is first created.useIdentityComparison - a flag to inidicate if the internal
comparisons should use the 'equals' method or simply use '=='.| Method Detail |
|---|
public Object remove(Object[] targetKeyList)
targetKeyList - the list of target keys to remove.
public Object get(Object key0,
Object key1)
key0 - the first key.key1 - the second key.
public Object get(Object key0,
Object key1,
Object key2)
key0 - the first key.key1 - the second key.key2 - the second key.
public Object get(Object key0,
Object key1,
Object key2,
Object key3)
key0 - the first key.key1 - the second key.key2 - the second key.key3 - the second key.
public Object put(Object key0,
Object key1,
Object value)
key0 - the first key.key1 - the second key.
public Object put(Object key0,
Object key1,
Object key2,
Object value)
key0 - the first key.key1 - the second key.key2 - the third key.
public Object put(Object key0,
Object key1,
Object key2,
Object key3,
Object value)
key0 - the first key.key1 - the second key.key2 - the third key.key3 - the fourth key.
public Object putIfAbsent(Object key0,
Object key1,
Object value)
key0 - the first key.key1 - the second key.
public Object putIfAbsent(Object key0,
Object key1,
Object key2,
Object value)
key0 - the first key.key1 - the second key.key2 - the third key.
public Object putIfAbsent(Object key0,
Object key1,
Object key2,
Object key3,
Object value)
key0 - the first key.key1 - the second key.key2 - the third key.key3 - the fourth key.
public int size()
public int keyCount()
public void add(MultiKeyHashtable otherHashtable)
otherHashtable - is another MultiKeyHashtable with the same keyCount.public Object clone()
clone in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||