package nl.tudelft.simulation.immutablecollections;
/**
* 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) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
* initial version Sep 22, 2016
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public enum Immutable
{
/**
* 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.
*/
COPY,
/**
* 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.
*/
WRAP;
/**
* @return whether the immutable is a COPY
*/
public boolean isCopy()
{
return this.equals(COPY);
}
/**
* @return whether the immutable is a WRAP
*/
public boolean isWrap()
{
return this.equals(WRAP);
}
}