K
- the key type of content of this MapV
- the value type of content of this Mappublic class ImmutableHashMap<K,V> extends ImmutableAbstractMap<K,V>
Copyright (c) 2016-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.
ImmutableMap.ImmutableEntry<K,V>
cachedValues, copyOrWrap
Constructor and Description |
---|
ImmutableHashMap(ImmutableAbstractMap<K,V> immutableMap) |
ImmutableHashMap(ImmutableAbstractMap<K,V> immutableMap,
Immutable copyOrWrap) |
ImmutableHashMap(Map<K,V> map) |
ImmutableHashMap(Map<K,V> map,
Immutable copyOrWrap) |
Modifier and Type | Method and Description |
---|---|
ImmutableSet<ImmutableMap.ImmutableEntry<K,V>> |
entrySet()
Returns a
Set view of the entries contained in this map. |
protected Map<K,V> |
getMap()
Prepare the map of the right type for use a subclass.
|
ImmutableSet<K> |
keySet()
Returns a
Set view of the keys contained in this map. |
Map<K,V> |
toMap()
Returns a modifiable copy of this immutable list.
|
String |
toString() |
containsKey, containsValue, equals, get, hashCode, isEmpty, isWrap, size, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, getOrDefault, isCopy
public ImmutableHashMap(Map<K,V> map)
map
- Map<K,V>; the map to use for the immutable map.public ImmutableHashMap(Map<K,V> map, Immutable copyOrWrap)
map
- Map<K,V>; the map to use for the immutable map.copyOrWrap
- COPY stores a safe, internal copy of the collection; WRAP stores a pointer to the original
collectionpublic ImmutableHashMap(ImmutableAbstractMap<K,V> immutableMap)
immutableMap
- ImmutableAbstractMap<K,V>; the map to use for the immutable map.public ImmutableHashMap(ImmutableAbstractMap<K,V> immutableMap, Immutable copyOrWrap)
immutableMap
- ImmutableAbstractMap<K,V>; the map to use for the immutable map.copyOrWrap
- COPY stores a safe, internal copy of the collection; WRAP stores a pointer to the original
collectionprotected final Map<K,V> getMap()
@Override protected HashMap<E> getMap() { return (HashMap<E>) super.getMap(); }
getMap
in class ImmutableAbstractMap<K,V>
public final Map<K,V> toMap()
public final ImmutableSet<K> keySet()
Set
view of the keys contained in this map.public ImmutableSet<ImmutableMap.ImmutableEntry<K,V>> entrySet()
Set
view of the entries contained in this map.public String toString()
toString
in class ImmutableAbstractMap<K,V>
Copyright © 2018–2019 Delft University of Technology. All rights reserved.