E
- the type of content of this EnumSetpublic class ImmutableEnumSet<E extends Enum<E>> extends ImmutableAbstractSet<E>
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
ImmutableEnumSet(EnumSet<E> enumSet) |
ImmutableEnumSet(ImmutableEnumSet<E> enumSet) |
Modifier and Type | Method and Description |
---|---|
static <E extends Enum<E>> |
copyOf(ImmutableEnumSet<E> s)
Creates an immutable enum set with the same element type as the specified immutable enum set, containing the same
elements (if any).
|
protected EnumSet<E> |
getSet()
Prepare the set of the right type for use a subclass.
|
EnumSet<E> |
toSet()
Returns a modifiable copy of this immutable set.
|
String |
toString() |
contains, containsAll, containsAll, equals, forEach, hashCode, isEmpty, iterator, parallelStream, size, spliterator, stream, toArray, toArray, toCollection
public ImmutableEnumSet(EnumSet<E> enumSet)
enumSet
- the set to use as the immutable set.public ImmutableEnumSet(ImmutableEnumSet<E> enumSet)
enumSet
- the set to use as the immutable set.protected final EnumSet<E> getSet()
@Override protected ArraySet<E> getSet() { return (ArraySet<E>) super.getSet(); }
getSet
in class ImmutableAbstractSet<E extends Enum<E>>
public final EnumSet<E> toSet()
public static <E extends Enum<E>> ImmutableEnumSet<E> copyOf(ImmutableEnumSet<E> s)
E
- The class of the elements in the sets
- the immutable enum set from which to initialize this immutable enum setNullPointerException
- if s is nullCopyright © 2014–2016 Delft University of Technology. All rights reserved.