SequencedCollection (Java SE 26 & JDK 26)
- Type Parameters:
E- the type of elements in this collection
- All Superinterfaces:
Collection<E>, Iterable<E>
- All Known Subinterfaces:
BlockingDeque<E>, Deque<E>, List<E>, NavigableSet<E>, SequencedSet<E>, SortedSet<E>
- All Known Implementing Classes:
AbstractList, AbstractSequentialList, ArrayDeque, ArrayList, AttributeList, ConcurrentLinkedDeque, ConcurrentSkipListSet, CopyOnWriteArrayList, LinkedBlockingDeque, LinkedHashSet, LinkedList, RoleList, RoleUnresolvedList, Stack, TreeSet, Vector
-
Method Summary
default voidAdds an element as the first element of this collection (optional operation).
default voidAdds an element as the last element of this collection (optional operation).
default EgetFirst()Gets the first element of this collection.
default EgetLast()Gets the last element of this collection.
default ERemoves and returns the first element of this collection (optional operation).
default ERemoves and returns the last element of this collection (optional operation).
reversed()Returns a reverse-ordered view of this collection.
Methods declared in interface Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArraybooleanEnsures 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.booleanCompares the specified object with this collection for equality.
intReturns the hash code value for this collection.
booleanReturns
trueif this collection contains no elements.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).
intReturns the number of elements in this collection.
Creates a
Spliteratorover the elements in this collection.Returns a sequential
Streamwith this collection as its source.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[]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
-
reversed
-
addFirst
-
addLast
-
getFirst
-
getLast
-
removeFirst
-
removeLast
-