Enum Immutable

java.lang.Object
java.lang.Enum<Immutable>
org.djutils.immutablecollections.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

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • 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

    Modifier and Type Method Description
    boolean isCopy()  
    boolean isWrap()  
    static Immutable valueOf​(String name)
    Returns the enum constant of this type with the specified name.
    static Immutable[] values()
    Returns an array containing the constants of this enum type, 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 type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

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