Package org.djutils.immutablecollections
Class ImmutableLinkedHashSet<E>
java.lang.Object
org.djutils.immutablecollections.ImmutableAbstractCollection<E>
org.djutils.immutablecollections.ImmutableAbstractSet<E>
org.djutils.immutablecollections.ImmutableLinkedHashSet<E>
- Type Parameters:
E
- the type of content of this Set
- All Implemented Interfaces:
Serializable
,Iterable<E>
,ImmutableCollection<E>
,ImmutableSet<E>
An immutable wrapper for a LinkedHashSet.
Copyright (c) 2016-2024 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.
$, initial version May 7, 2016- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
-
Field Summary
Fields inherited from class org.djutils.immutablecollections.ImmutableAbstractCollection
copyOrWrap
-
Constructor Summary
ConstructorDescriptionImmutableLinkedHashSet
(Collection<? extends E> collection) ImmutableLinkedHashSet
(Set<E> collection, Immutable copyOrWrap) ImmutableLinkedHashSet
(ImmutableAbstractCollection<? extends E> collection) ImmutableLinkedHashSet
(ImmutableAbstractSet<E> set, Immutable copyOrWrap) -
Method Summary
Methods inherited from class org.djutils.immutablecollections.ImmutableAbstractSet
contains, containsAll, containsAll, equals, forEach, hashCode, isEmpty, isWrap, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toCollection
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.djutils.immutablecollections.ImmutableCollection
isCopy
-
Constructor Details
-
ImmutableLinkedHashSet
- Parameters:
collection
- Collection<? extends E>; the collection to use for the immutable set.
-
ImmutableLinkedHashSet
- Parameters:
collection
- Set<E>; the collection to use for the immutable set.copyOrWrap
- COPY stores a safe, internal copy of the collection; WRAP stores a pointer to the original collection
-
ImmutableLinkedHashSet
- Parameters:
collection
- ImmutableAbstractCollection<? extends E>; the collection to use for the immutable set.
-
ImmutableLinkedHashSet
- Parameters:
set
- ImmutableAbstractSet<E>; the collection to use for the immutable set.copyOrWrap
- COPY stores a safe, internal copy of the collection; WRAP stores a pointer to the original collection
-
-
Method Details
-
getUnderlyingCollection
Description copied from class:ImmutableAbstractCollection
Returns the underlying collection of this immutable collection. In case of Immutable.WRAP, this will be the original collection. In case of IMMUTABLE.COPY, this will be the internally stored (mutable) copy of the collection.- Overrides:
getUnderlyingCollection
in classImmutableAbstractSet<E>
- Returns:
- the underlying collection of this immutable collection.
-
toSet
Description copied from interface:ImmutableSet
Returns a modifiable copy of this immutable set.- Returns:
- a modifiable copy of this immutable set.
-
toString
Description copied from interface:ImmutableSet
Force to redefine toString.- Specified by:
toString
in interfaceImmutableSet<E>
- Overrides:
toString
in classObject
- Returns:
- String; a description of this immutable set
-