|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.util.GroupHashtable<G,K,V>
G
- group classK
- key classV
- value classpublic class GroupHashtable<G,K,V>
The GroupHashtable
is a utility class to group multiple key/value pairs
with a single group key.
Its implementation has a Hashtable, for the group, which
contains multiple Hashtables, for the key/value pairs.
Constructor Summary | |
---|---|
GroupHashtable()
|
Method Summary | |
---|---|
void |
clear()
Clears all entries. |
void |
clear(G pGroup)
Clears all entries from a specific group. |
boolean |
constainsKey(G pGroup,
K pKey)
Tests if the specified object is a key in the group mapping. |
boolean |
containsValue(G pGroup,
V pValue)
Returns true if the group maps one or more keys to this value. |
Enumeration<V> |
elements(G pGroup)
Returns an enumeration of the values associated with a group, in this hashtable. |
Hashtable<K,V> |
get(G pGroup)
Returns the internal Hashtable associated with the pGroup . |
V |
get(G pGroup,
K pKey)
Returns the value to which the specified key is mapped. |
Enumeration<K> |
keys(G pGroup)
Returns an enumeration of the keys associated with a group, in this hashtable. |
void |
put(G pGroup,
K pKey,
V pValue)
Associates the specified value with the specified key to the group. |
boolean |
remove(G pGroup)
Removes the mapping of an entire group if it is present. |
V |
remove(G pGroup,
K pKey)
Removes the mapping for a key from its group if it is present. |
int |
size()
Returns the group count. |
int |
size(G pGroup)
Returns the number of group elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupHashtable()
Method Detail |
---|
public void put(G pGroup, K pKey, V pValue)
pGroup
- group identifierpKey
- key with which the specified value is to be associatedpValue
- value to be associated with the specified keypublic V get(G pGroup, K pKey)
pGroup
- group identifierpKey
- the key whose associated value is to be returned
public Hashtable<K,V> get(G pGroup)
Hashtable
associated with the pGroup
.
pGroup
- group identifier
Hashtable
which is mapped to the specified group or null
if the pGroup
is not mappedpublic boolean remove(G pGroup)
pGroup
- group identifier
public V remove(G pGroup, K pKey)
pGroup
- group identifierpKey
- key to remove
public int size()
public int size(G pGroup)
pGroup
- group identifier
public Enumeration<V> elements(G pGroup)
pGroup
- group identifier
public Enumeration<K> keys(G pGroup)
pGroup
- group identifier
public boolean containsValue(G pGroup, V pValue)
pGroup
- group identifierpValue
- value whose presence is to be tested
public boolean constainsKey(G pGroup, K pKey)
pGroup
- group identifierpKey
- possible key
public void clear()
public void clear(G pGroup)
pGroup
- the group identifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |