Package org.apache.commons.collections4
Class SplitMapUtils.WrappedGet<K,V>
java.lang.Object
org.apache.commons.collections4.SplitMapUtils.WrappedGet<K,V>
- All Implemented Interfaces:
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 Object
implements IterableMap<K,V>, Unmodifiable
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
int
hashCode()
boolean
isEmpty()
keySet()
Obtains aMapIterator
over the map.Note that the return type is Object, rather than V as in the Map interface.void
int
size()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
get
-
-
Constructor Details
-
WrappedGet
-
-
Method Details
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceGet<K,
V> - Specified by:
containsKey
in interfaceMap<K,
V> - Parameters:
key
- key whose presence in this map is to be tested- Returns:
true
if this map contains a mapping for the specified key- See Also:
-
containsValue
- Specified by:
containsValue
in interfaceGet<K,
V> - Specified by:
containsValue
in interfaceMap<K,
V> - Parameters:
value
- value whose presence in this map is to be tested- Returns:
true
if this map maps one or more keys to the specified value- See Also:
-
entrySet
-
equals
-
get
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
keySet
-
put
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 interfaceMap<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:
-
putAll
-
remove
-
size
public int size() -
values
-
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
-