Package com.globalmentor.collections
Class MapEntryMap<K,V>
- java.lang.Object
-
- com.globalmentor.collections.MapEntryMap<K,V>
-
- Type Parameters:
K
- The type of key contained in the map.V
- The type of value contained in the map.
- All Implemented Interfaces:
ImmutableMap<K,V>
,java.util.Map<K,V>
public class MapEntryMap<K,V> extends java.lang.Object implements java.util.Map<K,V>, ImmutableMap<K,V>
A read-only map containing a single map entry.- Author:
- Garret Wilson
-
-
Constructor Summary
Constructors Constructor Description MapEntryMap(NameValuePair<K,V> nameValuePair)
Name/value pair copy constructor.MapEntryMap(java.util.Map.Entry<K,V> mapEntry)
Map entry copy constructor.MapEntryMap(K key, V value)
Key and value constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,V>>
entrySet()
boolean
equals(java.lang.Object o)
V
get(java.lang.Object key)
int
hashCode()
boolean
isEmpty()
java.util.Set<K>
keySet()
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
V
remove(java.lang.Object key)
int
size()
java.util.Collection<V>
values()
-
-
-
Constructor Detail
-
MapEntryMap
public MapEntryMap(K key, V value)
Key and value constructor.- Parameters:
key
- The key to hold in the map.value
- The value to hold in the map.
-
MapEntryMap
public MapEntryMap(NameValuePair<K,V> nameValuePair)
Name/value pair copy constructor.- Parameters:
nameValuePair
- The name/value pair the values of which to hold in the map.- Throws:
java.lang.NullPointerException
- if the given name/value pair isnull
.
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
values
public java.util.Collection<V> values()
-
equals
public boolean equals(java.lang.Object o)
-
-