Package org.djutils.immutablecollections
Enum Class Immutable
- All Implemented Interfaces:
Serializable
,Comparable<Immutable>
,Constable
Indicate whether the immutable collection contains a COPY of the collection (neither changeable by the user of the immutable
collection, nor by anyone holding a pointer to the original collection), or a WRAP for the original collection (not
changeable by the user of the immutable collection, but can be changed by anyone holding a pointer to the original collection
that is wrapped).
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.
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA copy is neither changeable by the user of the immutable collection, nor by anyone holding a pointer to the original collection that is put into the immutable collection.A wrapped immutable collection is not changeable by the user of the immutable collection, but can be changed by anyone holding a pointer to the original collection that is wrapped. -
Method Summary
-
Enum Constant Details
-
COPY
A copy is neither changeable by the user of the immutable collection, nor by anyone holding a pointer to the original collection that is put into the immutable collection. -
WRAP
A wrapped immutable collection is not changeable by the user of the immutable collection, but can be changed by anyone holding a pointer to the original collection that is wrapped.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isCopy
public boolean isCopy()- Returns:
- whether the immutable is a COPY
-
isWrap
public boolean isWrap()- Returns:
- whether the immutable is a WRAP
-