public abstract class CollectionMap<K,V> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Comparator<V> |
comparator
An optional comparator.
|
| Constructor and Description |
|---|
CollectionMap() |
CollectionMap(CollectionMap<K,V> other) |
CollectionMap(CollectionMap<K,V> other,
Comparator<V> comparator) |
CollectionMap(Comparator<V> comparator) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
add(Collection<V> c,
V o) |
boolean |
contains(K key,
Object o)
Return true if the specified set contains the object o.
|
Collection<V> |
get(K key)
Return the collection specified by the key.
|
Iterator<V> |
iterator(K key)
Return an iterator over the values in the set specified by the key.
|
Set<K> |
keySet()
Return the set of keys.
|
protected abstract Collection<V> |
newCollection() |
protected abstract Collection<V> |
newCollection(Collection<V> other) |
void |
put(K key,
V o)
Add an object in the set keyed under the specified key.
|
protected abstract void |
remove(Collection<V> c,
Object o)
Removes an object from the collection.
|
void |
remove(K key)
Remove the entire set of objects specified by the key.
|
void |
remove(K key,
Object o)
Remove an object in the set keyed under the specified key.
|
protected Comparator<V> comparator
public CollectionMap()
public CollectionMap(CollectionMap<K,V> other) throws IllegalArgumentException
IllegalArgumentExceptionpublic CollectionMap(CollectionMap<K,V> other, Comparator<V> comparator) throws IllegalArgumentException
IllegalArgumentExceptionpublic CollectionMap(Comparator<V> comparator)
public final void put(K key, V o) throws NullPointerException
NullPointerException - if the key is nullpublic final void remove(K key) throws NullPointerException
NullPointerException - if the key is nullpublic final void remove(K key, Object o) throws NullPointerException
NullPointerException - if the key is nullpublic final boolean contains(K key, Object o) throws NullPointerException
NullPointerException - if the key is nullpublic Collection<V> get(K key)
public final Iterator<V> iterator(K key)
NullPointerException - if the key is nullprotected abstract void add(Collection<V> c, V o)
protected abstract void remove(Collection<V> c, Object o)
Object and
not the parameterized type because the Collectionc - the collection to remove fromo - the object to removeprotected abstract Collection<V> newCollection()
protected abstract Collection<V> newCollection(Collection<V> other)
Copyright © 2025 JBoss by Red Hat. All Rights Reserved.