KEY
- ITEM
- public class HashMapSet<KEY,ITEM> extends HashMap<KEY,Set<ITEM>>
The implementation is unsynchronized, created sets are synchronized (just iteration over the set must be synchronized by the user as described in Java(tm) documentation).
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
HashMapSet() |
Modifier and Type | Method and Description |
---|---|
void |
add(KEY key,
ITEM item)
Adds the item into the set under the key.
|
boolean |
contains(KEY key,
ITEM item)
Tests whether an 'item' is inside the set under 'key'.
|
Set<ITEM> |
get(Object primaryKey)
The get method ensures that the requested set under primaryKey always exists!
|
boolean |
remove(KEY key,
ITEM item)
Removes the item from the set under the key.
|
Set<ITEM> |
remove(Object key)
Remove returns the removed item, if item was non-existent, it returns empty set.
|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, size, values
equals, hashCode, toString
public Set<ITEM> get(Object primaryKey)
public void add(KEY key, ITEM item)
key
- item
- public Set<ITEM> remove(Object key)
public boolean remove(KEY key, ITEM item)
key
- item
- Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.