Class KeyCollectionAsMap<K,E>
java.lang.Object
org.magicwerk.brownies.collections.KeyCollectionAsMap<K,E>
- All Implemented Interfaces:
Serializable
,Map<K,
E>
Implements a Map based on a key map in a KeyCollection or KeyList.
- See Also:
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) KeyCollectionImpl
<E> Reference to KeyCollectionImpl containing data (exactly one of the fields coll and list is set)(package private) boolean
(package private) int
(package private) KeyListImpl
<E> Reference to KeyListImpl containing data (exactly one of the fields coll and list is set) -
Constructor Summary
ConstructorsConstructorDescriptionKeyCollectionAsMap
(KeyCollectionImpl<E> coll, int keyIndex, boolean immutable) KeyCollectionAsMap
(KeyListImpl<E> list, int keyIndex, boolean immutable) -
Method Summary
Methods inherited from class java.lang.Object
clone, 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
-
Field Details
-
coll
KeyCollectionImpl<E> collReference to KeyCollectionImpl containing data (exactly one of the fields coll and list is set) -
list
KeyListImpl<E> listReference to KeyListImpl containing data (exactly one of the fields coll and list is set) -
keyIndex
int keyIndex -
immutable
boolean immutable
-
-
Constructor Details
-
KeyCollectionAsMap
-
KeyCollectionAsMap
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
E>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
E>
-
get
-
keySet
Note that the returned set is immutable.
-
entrySet
Note that the returned set is immutable.
-
values
-
checkMutable
void checkMutable() -
clear
public void clear() -
put
-
remove
-
putAll
-