|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openbandy.util.TwoWayHashtable
public class TwoWayHashtable
Wrapper for java.util.Hashtable with methods to get objects as well as well
as keys by hash.
(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.
Constructor Summary | |
---|---|
TwoWayHashtable()
|
Method Summary | |
---|---|
void |
clear()
Removes all elements from the hashtable. |
boolean |
containsKey(java.lang.Object key)
Check if the hashtable contains the given key object. |
boolean |
containsValue(java.lang.Object value)
Check if the hashtable contains the given value object. |
java.lang.Object |
getKeyByValue(java.lang.Object value)
Return the key of the hashtable using the value object. |
java.util.Enumeration |
getKeys()
Return an enumeration of all key objects. |
java.lang.Object |
getValueByKey(java.lang.Object key)
Returns the value objects using the key object as reference. |
java.util.Enumeration |
getValues()
Return an enumeration of all value objects. |
void |
put(java.lang.Object key,
java.lang.Object value)
Put an value object into the hashtable using the
key object as reference. |
java.lang.Object |
removeByKey(java.lang.Object key)
Remove an element from the hashtable using the key. |
java.lang.Object |
removeByValue(java.lang.Object value)
Remove an element from the hashtable using the value as key. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwoWayHashtable()
Method Detail |
---|
public void put(java.lang.Object key, java.lang.Object value)
value
object into the hashtable using the
key
object as reference.
key
- The key object.value
- The value object.public boolean containsKey(java.lang.Object key)
key
- The key object to check for.
public boolean containsValue(java.lang.Object value)
value
- The value object to check for.
public java.lang.Object getValueByKey(java.lang.Object key)
key
- The key object.
public java.util.Enumeration getValues()
public java.util.Enumeration getKeys()
public java.lang.Object getKeyByValue(java.lang.Object value)
value
- Value object.
public java.lang.Object removeByKey(java.lang.Object key)
key
- Key object.
public java.lang.Object removeByValue(java.lang.Object value)
value
- Value object.
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |