|
||||||||||
| 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 |
containsGroup(G pGroup)
Gets whether the group exists. |
boolean |
containsKey(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. |
java.util.Enumeration<V> |
elements(G pGroup)
Returns an enumeration of the values associated with a group, in this hashtable. |
java.util.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. |
java.util.Enumeration<G> |
groups()
Returns an enumeration of all groups. |
java.util.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. |
java.util.List<V> |
removeKey(K pKey)
Removes the given key from all groups, if possible. |
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 key
public V get(G pGroup,
K pKey)
pGroup - group identifierpKey - the key whose associated value is to be returned
public java.util.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 java.util.Enumeration<V> elements(G pGroup)
pGroup - group identifier
public java.util.Enumeration<K> keys(G pGroup)
pGroup - group identifier
public java.util.Enumeration<G> groups()
public java.util.List<V> removeKey(K pKey)
pKey - the key to remove
null if no value was removedpublic boolean containsGroup(G pGroup)
pGroup - the group identifier
true if the group exists, false otherwise
public boolean containsValue(G pGroup,
V pValue)
pGroup - group identifierpValue - value whose presence is to be tested
public boolean containsKey(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 | |||||||||