Class KeyCollectionAsMap<K,E>
- java.lang.Object
-
- org.magicwerk.brownies.collections.KeyCollectionAsMap<K,E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Map<K,E>
public class KeyCollectionAsMap<K,E> extends java.lang.Object implements java.util.Map<K,E>, java.io.Serializable
Implements a Map based on a key map in a KeyCollection or KeyList.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) KeyCollectionImpl<E>
coll
Reference to KeyCollectionImpl containing data (exactly one of the fields coll and list is set)(package private) boolean
immutable
(package private) int
keyIndex
(package private) KeyListImpl<E>
list
Reference to KeyListImpl containing data (exactly one of the fields coll and list is set)
-
Constructor Summary
Constructors Constructor Description KeyCollectionAsMap(KeyCollectionImpl<E> coll, int keyIndex, boolean immutable)
KeyCollectionAsMap(KeyListImpl<E> list, int keyIndex, boolean immutable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
checkMutable()
void
clear()
boolean
containsKey(java.lang.Object key)
boolean
containsValue(java.lang.Object value)
java.util.Set<java.util.Map.Entry<K,E>>
entrySet()
boolean
equals(java.lang.Object o)
E
get(java.lang.Object key)
int
hashCode()
boolean
isEmpty()
java.util.Set<K>
keySet()
E
put(K key, E elem)
void
putAll(java.util.Map<? extends K,? extends E> map)
E
remove(java.lang.Object key)
int
size()
java.lang.String
toString()
java.util.Collection<E>
values()
-
-
-
Field Detail
-
coll
KeyCollectionImpl<E> coll
Reference to KeyCollectionImpl containing data (exactly one of the fields coll and list is set)
-
list
KeyListImpl<E> list
Reference to KeyListImpl containing data (exactly one of the fields coll and list is set)
-
keyIndex
int keyIndex
-
immutable
boolean immutable
-
-
Constructor Detail
-
KeyCollectionAsMap
public KeyCollectionAsMap(KeyCollectionImpl<E> coll, int keyIndex, boolean immutable)
-
KeyCollectionAsMap
public KeyCollectionAsMap(KeyListImpl<E> list, int keyIndex, boolean immutable)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
containsKey
public boolean containsKey(java.lang.Object key)
-
containsValue
public boolean containsValue(java.lang.Object value)
-
keySet
public java.util.Set<K> keySet()
Note that the returned set is immutable.
-
entrySet
public java.util.Set<java.util.Map.Entry<K,E>> entrySet()
Note that the returned set is immutable.
-
values
public java.util.Collection<E> values()
-
checkMutable
void checkMutable()
-
-