Package org.djutils.immutablecollections
Class ImmutableLinkedHashMap<K,V>
java.lang.Object
org.djutils.immutablecollections.ImmutableAbstractMap<K,V>
org.djutils.immutablecollections.ImmutableLinkedHashMap<K,V>
- Type Parameters:
K
- the key type of content of this MapV
- the value type of content of this Map
- All Implemented Interfaces:
Serializable
,ImmutableMap<K,V>
public class ImmutableLinkedHashMap<K,V> extends ImmutableAbstractMap<K,V>
An immutable wrapper for a LinkedHashMap.
Copyright (c) 2016-2020 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.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.djutils.immutablecollections.ImmutableMap
ImmutableMap.ImmutableEntry<K,V>
-
Field Summary
Fields inherited from class org.djutils.immutablecollections.ImmutableAbstractMap
cachedValues, copyOrWrap
-
Constructor Summary
Constructors Constructor Description ImmutableLinkedHashMap(Map<K,V> map)
ImmutableLinkedHashMap(Map<K,V> map, Immutable copyOrWrap)
ImmutableLinkedHashMap(ImmutableAbstractMap<K,V> immutableMap)
ImmutableLinkedHashMap(ImmutableAbstractMap<K,V> immutableMap, Immutable copyOrWrap)
-
Method Summary
Modifier and Type Method Description ImmutableSet<ImmutableMap.ImmutableEntry<K,V>>
entrySet()
Returns aSet
view of the entries contained in this map.protected Map<K,V>
getUnderlyingMap()
Return the raw underlying map.ImmutableSet<K>
keySet()
Returns aSet
view of the keys contained in this map.Map<K,V>
toMap()
Returns a modifiable copy of this immutable list.String
toString()
Force to redefine toString.ImmutableCollection<V>
values()
Returns aImmutableCollection
view of the values contained in this map.Methods inherited from class org.djutils.immutablecollections.ImmutableAbstractMap
containsKey, containsValue, equals, get, hashCode, isEmpty, isWrap, size
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.immutablecollections.ImmutableMap
forEach, getOrDefault, isCopy
-
Constructor Details
-
ImmutableLinkedHashMap
- Parameters:
map
- Map<K,V>; the map to use for the immutable map.
-
ImmutableLinkedHashMap
- Parameters:
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 collection
-
ImmutableLinkedHashMap
- Parameters:
immutableMap
- ImmutableAbstractMap<K,V>; the map to use for the immutable map.
-
ImmutableLinkedHashMap
- Parameters:
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 collection
-
-
Method Details
-
getUnderlyingMap
Return the raw underlying map.- Overrides:
getUnderlyingMap
in classImmutableAbstractMap<K,V>
- Returns:
- Map<K, V>; the raw underlying map
-
toMap
Returns a modifiable copy of this immutable list.- Returns:
- a modifiable copy of this immutable list.
-
keySet
Returns aSet
view of the keys contained in this map.- Returns:
- an immutable set of the keys contained in this map
-
entrySet
Returns aSet
view of the entries contained in this map.- Returns:
- an immutable set of the entries contained in this map
-
values
Returns aImmutableCollection
view of the values contained in this map.- Specified by:
values
in interfaceImmutableMap<K,V>
- Overrides:
values
in classImmutableAbstractMap<K,V>
- Returns:
- an immutable collection view of the values contained in this map
-
toString
Force to redefine toString.
-