Package org.apache.commons.collections4
Class SplitMapUtils.WrappedGet<K,V>
- java.lang.Object
-
- org.apache.commons.collections4.SplitMapUtils.WrappedGet<K,V>
-
- All Implemented Interfaces:
java.util.Map<K,V>
,Get<K,V>
,IterableGet<K,V>
,IterableMap<K,V>
,Put<K,V>
,Unmodifiable
- Enclosing class:
- SplitMapUtils
private static class SplitMapUtils.WrappedGet<K,V> extends java.lang.Object implements IterableMap<K,V>, Unmodifiable
-
-
Constructor Summary
Constructors Modifier Constructor Description private
WrappedGet(Get<K,V> get)
-
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 arg0)
V
get(java.lang.Object key)
int
hashCode()
boolean
isEmpty()
java.util.Set<K>
keySet()
MapIterator<K,V>
mapIterator()
Obtains aMapIterator
over the map.V
put(K key, V value)
Note that the return type is Object, rather than V as in the Map interface.void
putAll(java.util.Map<? extends K,? extends V> t)
V
remove(java.lang.Object key)
int
size()
java.util.Collection<V>
values()
-
-
-
Method Detail
-
clear
public void clear()
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
equals
public boolean equals(java.lang.Object arg0)
-
get
public V get(java.lang.Object key)
-
hashCode
public int hashCode()
-
isEmpty
public boolean isEmpty()
-
keySet
public java.util.Set<K> keySet()
-
put
public V put(K key, V value)
Description copied from interface:Put
Note that the return type is Object, rather than V as in the Map interface. See the class Javadoc for further info.- Specified by:
put
in interfacejava.util.Map<K,V>
- Specified by:
put
in interfacePut<K,V>
- Parameters:
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified key- Returns:
- the previous value associated with
key
, ornull
if there was no mapping forkey
. (Anull
return can also indicate that the map previously associatednull
withkey
, if the implementation supportsnull
values.) - See Also:
Map.put(Object, Object)
-
remove
public V remove(java.lang.Object key)
-
size
public int size()
-
values
public java.util.Collection<V> values()
-
mapIterator
public MapIterator<K,V> mapIterator()
Description copied from interface:IterableGet
Obtains aMapIterator
over the map.A map iterator is an efficient way of iterating over maps. There is no need to access the entry set or use Map Entry objects.
IterableMap<String,Integer> map = new HashedMap<String,Integer>(); MapIterator<String,Integer> it = map.mapIterator(); while (it.hasNext()) { String key = it.next(); Integer value = it.getValue(); it.setValue(value + 1); }
- Specified by:
mapIterator
in interfaceIterableGet<K,V>
- Returns:
- a map iterator
-
-