public class BagMap<K extends Serializable,V extends Serializable> extends Object implements Iterable<Map.Entry<K,V>>, Serializable
| Constructor and Description |
|---|
BagMap()
Makes a new empty bag map.
|
| Modifier and Type | Method and Description |
|---|---|
BagMap<K,V> |
add(K key,
V value)
Adds an entry.
|
boolean |
containsKey(K key)
Is there an entry with this key?
|
boolean |
empty() |
Collection<Map.Entry<K,V>> |
entries()
All entries.
|
V |
get(K key)
Gets the value of the first entry with that key, or null if there is none.
|
List<V> |
getValues(K key)
Gets all the values for a key, in the order that they were inserted.
|
boolean |
isEmpty() |
Iterable<Map.Entry<K,V>> |
iteratable()
All the entries in the order they were inserted.
|
Iterator<Map.Entry<K,V>> |
iterator()
All the entries in the order they were inserted.
|
Collection<K> |
keys()
All keys that have a value.
|
void |
remove(K key)
Removes all entries with this key.
|
void |
set(K key,
V value)
Sets the first entry with this key to this value and removes all the others.
|
Collection<V> |
values()
All values.
|
public BagMap<K,V> add(K key, V value)
public List<V> getValues(K key)
public boolean containsKey(K key)
public void remove(K key)
public void set(K key, V value)
public boolean isEmpty()
public boolean empty()
public Iterator<Map.Entry<K,V>> iterator()
iterator in interface Iterable<Map.Entry<K extends Serializable,V extends Serializable>>public Iterable<Map.Entry<K,V>> iteratable()
public Collection<K> keys()
public Collection<V> values()
public Collection<Map.Entry<K,V>> entries()
Copyright © 2016. All rights reserved.