Package org.infinispan.commons.util
Class ArrayMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.infinispan.commons.util.ArrayMap<K,V>
-
- All Implemented Interfaces:
Map<K,V>
- Direct Known Subclasses:
HopscotchHashMap
public abstract class ArrayMap<K,V> extends AbstractMap<K,V>
Base for classes that implement hash map by storing keys in one array and values in another. It assumes that all keys that are in the array are contained in the map and that values are on corresponding indices in the map. Does not support null keys nor values. Forces implementation of methodsget(Object)
,put(Object, Object)
,remove(Object)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ArrayMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<K,V>>
entrySet()
abstract V
get(Object key)
Set<K>
keySet()
abstract V
put(K key, V value)
abstract V
remove(Object key)
int
size()
Collection<V>
values()
-
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, isEmpty, putAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
size
public int size()
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<K,V>
- Overrides:
containsValue
in classAbstractMap<K,V>
-
values
public Collection<V> values()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<K,V>
- Overrides:
containsKey
in classAbstractMap<K,V>
-
-