Enum Class Immutable

java.lang.Object
java.lang.Enum<Immutable>
org.djutils.immutablecollections.Immutable
All Implemented Interfaces:
Serializable, Comparable<Immutable>, 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-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 Constants
    Enum Constant
    Description
    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.
    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

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
    static Immutable
    Returns the enum constant of this class with the specified name.
    static Immutable[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • COPY

      public static final Immutable 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

      public static final Immutable 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

      public static Immutable[] 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

      public static Immutable valueOf(String name)
      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 name
      NullPointerException - 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