Package org.djutils.immutablecollections
Enum Immutable
- All Implemented Interfaces:
Serializable
,Comparable<Immutable>
,java.lang.constant.Constable
public enum Immutable extends Enum<Immutable>
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-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
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description 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 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 type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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
-