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!
|
Set<ITEM> |
remove(Object key)
Remove returns the removed item, if item was non-existent, it returns empty set.
|
boolean |
removeItem(Object key,
Object item)
Removes the item from the set under the key.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic Set<ITEM> get(Object primaryKey)
public void add(KEY key, ITEM item)
key - item - public Set<ITEM> remove(Object key)
public boolean removeItem(Object key, Object item)
key - item - Copyright © 2019 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All rights reserved.