|
|||||||||
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. |
java.lang.Object |
clone()
Creates a copy of the receiver including a copy of the internal keys and values arrays. |
java.lang.Object |
get(java.lang.Object key0,
java.lang.Object key1)
Locates and returns the value keyed by the two keys key0, key1. |
java.lang.Object |
get(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2)
Locates and returns the value keyed by the three keys key0, key1, key2. |
java.lang.Object |
get(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2,
java.lang.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. |
java.lang.Object |
put(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object value)
Inserts the value keyed by the two keys key0, key1. |
java.lang.Object |
put(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2,
java.lang.Object value)
Inserts the value keyed by the three keys key0, key1, key2. |
java.lang.Object |
put(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2,
java.lang.Object key3,
java.lang.Object value)
Inserts the value keyed by the four keys key0, key1, key2, key3. |
java.lang.Object |
putIfAbsent(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object value)
See put(..). |
java.lang.Object |
putIfAbsent(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2,
java.lang.Object value)
See put(..). |
java.lang.Object |
putIfAbsent(java.lang.Object key0,
java.lang.Object key1,
java.lang.Object key2,
java.lang.Object key3,
java.lang.Object value)
See put(..). |
java.lang.Object |
remove(java.lang.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 java.lang.Object remove(java.lang.Object[] targetKeyList)
targetKeyList
- the list of target keys to remove.
public java.lang.Object get(java.lang.Object key0, java.lang.Object key1)
key0
- the first key.key1
- the second key.
public java.lang.Object get(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2)
key0
- the first key.key1
- the second key.key2
- the second key.
public java.lang.Object get(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2, java.lang.Object key3)
key0
- the first key.key1
- the second key.key2
- the second key.key3
- the second key.
public java.lang.Object put(java.lang.Object key0, java.lang.Object key1, java.lang.Object value)
key0
- the first key.key1
- the second key.
public java.lang.Object put(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2, java.lang.Object value)
key0
- the first key.key1
- the second key.key2
- the third key.
public java.lang.Object put(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2, java.lang.Object key3, java.lang.Object value)
key0
- the first key.key1
- the second key.key2
- the third key.key3
- the fourth key.
public java.lang.Object putIfAbsent(java.lang.Object key0, java.lang.Object key1, java.lang.Object value)
key0
- the first key.key1
- the second key.
public java.lang.Object putIfAbsent(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2, java.lang.Object value)
key0
- the first key.key1
- the second key.key2
- the third key.
public java.lang.Object putIfAbsent(java.lang.Object key0, java.lang.Object key1, java.lang.Object key2, java.lang.Object key3, java.lang.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 java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |