EnumSet (Java SE 26 & JDK 26)
- Type Parameters:
E- the enum type of elements maintained by this set
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E>
-
Method Summary
Creates an enum set containing all of the elements in the specified element type.
clone()Returns a copy of this set.
Creates an enum set with the same element type as the specified enum set, initially containing all the elements of this type that are not contained in the specified set.
Creates an enum set initialized from the specified collection.
Creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any).
Creates an empty enum set with the specified element type.
of(E e) Creates an enum set initially containing the specified element.
of(E e1, E e2) Creates an enum set initially containing the specified elements.
of(E first, E... rest) Creates an enum set initially containing the specified elements.
of(E e1, E e2, E e3) Creates an enum set initially containing the specified elements.
of(E e1, E e2, E e3, E e4) Creates an enum set initially containing the specified elements.
of(E e1, E e2, E e3, E e4, E e5) Creates an enum set initially containing the specified elements.
range(E from, E to) Creates an enum set initially containing all of the elements in the range defined by the two specified endpoints.
Methods declared in class AbstractSet
booleanCompares the specified object with this set for equality.
intReturns the hash code value for this set.
booleanRemoves from this set all of its elements that are contained in the specified collection (optional operation).
Methods declared in class AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, toArray, toArray, toStringbooleanEnsures that this collection contains the specified element (optional operation).
booleanAdds all of the elements in the specified collection to this collection (optional operation).
voidRemoves all of the elements from this collection (optional operation).
booleanReturns
trueif this collection contains the specified element.booleanReturns
trueif this collection contains all of the elements in the specified collection.booleanReturns
trueif this collection contains no elements.Returns an iterator over the elements contained in this collection.
booleanRemoves a single instance of the specified element from this collection, if it is present (optional operation).
booleanRetains only the elements in this collection that are contained in the specified collection (optional operation).
Returns an array containing all of the elements in this collection.
<T> T[]Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
Returns a string representation of this collection.
Methods declared in class Object
finalize, getClass, notify, notifyAll, wait, wait, waitprotected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
Methods declared in interface Collection
parallelStream, removeIf, stream, toArrayReturns a possibly parallel
Streamwith this collection as its source.default booleanRemoves all of the elements of this collection that satisfy the given predicate (optional operation).
Returns a sequential
Streamwith this collection as its source.default <T> T[]Returns an array containing all of the elements in this collection, using the provided
generatorfunction to allocate the returned array.Methods declared in interface Iterable
default voidPerforms the given action for each element of the
Iterableuntil all elements have been processed or the action throws an exception.Methods declared in interface Set
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, spliterator, toArray, toArraybooleanAdds the specified element to this set if it is not already present (optional operation).
booleanAdds all of the elements in the specified collection to this set if they're not already present (optional operation).
voidRemoves all of the elements from this set (optional operation).
booleanReturns
trueif this set contains the specified element.booleanReturns
trueif this set contains all of the elements of the specified collection.booleanReturns
trueif this set contains no elements.Returns an iterator over the elements in this set.
booleanRemoves the specified element from this set if it is present (optional operation).
booleanRetains only the elements in this set that are contained in the specified collection (optional operation).
intReturns the number of elements in this set (its cardinality).
Creates a
Spliteratorover the elements in this set.Returns an array containing all of the elements in this set.
<T> T[]Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.
-
Method Details
-
noneOf
-
allOf
-
copyOf
-
copyOf
-
complementOf
-
of
-
of
-
of
-
of
-
of
-
of
-
range
-
clone
-