Collection (Java SE 26 & JDK 26)
- Type Parameters:
E- the type of elements in this collection
- All Superinterfaces:
Iterable<E>
- All Known Subinterfaces:
BeanContext, BeanContextServices, BlockingDeque<E>, BlockingQueue<E>, Deque<E>, EventSet, List<E>, NavigableSet<E>, Queue<E>, SequencedCollection<E>, SequencedSet<E>, Set<E>, SortedSet<E>, TransferQueue<E>
- All Known Implementing Classes:
AbstractCollection, AbstractList, AbstractQueue, AbstractSequentialList, AbstractSet, ArrayBlockingQueue, ArrayDeque, ArrayList, AttributeList, BeanContextServicesSupport, BeanContextSupport, ConcurrentHashMap.KeySetView, ConcurrentLinkedDeque, ConcurrentLinkedQueue, ConcurrentSkipListSet, CopyOnWriteArrayList, CopyOnWriteArraySet, DelayQueue, EnumSet, HashSet, JobStateReasons, LinkedBlockingDeque, LinkedBlockingQueue, LinkedHashSet, LinkedList, LinkedTransferQueue, PriorityBlockingQueue, PriorityQueue, RoleList, RoleUnresolvedList, Stack, SynchronousQueue, TreeSet, Vector
-
Method Summary
booleanEnsures that this collection contains the specified element (optional operation).
booleanAdds all of the elements in the specified collection to this collection (optional operation).
voidclear()Removes 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.booleanCompares the specified object with this collection for equality.
inthashCode()Returns the hash code value for this collection.
booleanisEmpty()Returns
trueif this collection contains no elements.iterator()Returns an iterator over the elements in this collection.
Returns a possibly parallel
Streamwith this collection as its source.booleanRemoves a single instance of the specified element from this collection, if it is present (optional operation).
booleanRemoves all of this collection's elements that are also contained in the specified collection (optional operation).
default booleanRemoves all of the elements of this collection that satisfy the given predicate (optional operation).
booleanRetains only the elements in this collection that are contained in the specified collection (optional operation).
intsize()Returns the number of elements in this collection.
Creates a
Spliteratorover the elements in this collection.stream()Returns a sequential
Streamwith this collection as its source.toArray()Returns an array containing all of the elements in this collection.
default <T> T[]Returns an array containing all of the elements in this collection, using the provided
generatorfunction to allocate the returned array.<T> T[]toArray(T[] a) Returns an array containing all of the elements in this collection; the runtime type of the returned array is that of the specified array.
-
Method Details
-
size
-
isEmpty
-
contains
-
iterator
-
toArray
-
toArray
-
toArray
-
add
-
remove
-
containsAll
-
addAll
-
removeAll
-
removeIf
-
retainAll
-
clear
-
equals
-
hashCode
-
spliterator
-
stream
-
parallelStream
-