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.SerializableImplements 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>collReference to KeyCollectionImpl containing data (exactly one of the fields coll and list is set)(package private) booleanimmutable(package private) intkeyIndex(package private) KeyListImpl<E>listReference 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) voidcheckMutable()voidclear()booleancontainsKey(java.lang.Object key)booleancontainsValue(java.lang.Object value)java.util.Set<java.util.Map.Entry<K,E>>entrySet()booleanequals(java.lang.Object o)Eget(java.lang.Object key)inthashCode()booleanisEmpty()java.util.Set<K>keySet()Eput(K key, E elem)voidputAll(java.util.Map<? extends K,? extends E> map)Eremove(java.lang.Object key)intsize()java.lang.StringtoString()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:
toStringin 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()
-
-