|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.ac.ebi.intact.application.goDensity.business.data.Key2HashSet
Key2HashSet with unique (!) Values for a key. That means, it is realated to a Hashtable: you have keys, and for each key you get a set of unique values / Objects (internally stored in a HashSet).
| Field Summary | |
protected java.util.Hashtable |
_key2HashSet
All keys are stored in this Hashtable. |
protected java.util.HashSet |
_values
Each value within the Hashtable _key2HashSet hast on HashSet - set of unique values |
| Constructor Summary | |
Key2HashSet()
default Constructor |
|
| Method Summary | |
boolean |
add(java.lang.String key,
java.lang.Object value)
Allows to add a key / value pair. |
boolean |
containsKey(java.lang.String key)
test, if Key2HashSet already contains the String "key" |
java.util.Hashtable |
getAll()
Allows to get all HashSets for all keys and all keys itself. |
java.util.Enumeration |
getKeys()
|
java.util.HashSet |
getValueByKey(java.lang.String key)
Allows to get the related HashSet by the unique key. |
java.lang.String |
toString()
toString Method for Key2HashSet Example output: key: ac2 -> values: [10, 30, 20] key: ac1 -> values: [2, 1] |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable _key2HashSet
protected java.util.HashSet _values
| Constructor Detail |
public Key2HashSet()
| Method Detail |
public boolean add(java.lang.String key,
java.lang.Object value)
key - - the keywordvalue - - Object, which should be added for the key parameter.
Object "value" must implement the equals(Object o) and hasCode() method,
otherwise it will not be added! If key has already a value, this
value will be added as long as it is not already there (HashSet)
public java.util.HashSet getValueByKey(java.lang.String key)
throws KeyNotFoundException
key - - key
KeyNotFoundException - - if key was not foundpublic java.util.Hashtable getAll()
public java.util.Enumeration getKeys()
public boolean containsKey(java.lang.String key)
key - which should be tested if it is already added
true if and only if the specified key
is a key in this Key2HashSet; false otherwise.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||