Interface IntDeque
- All Superinterfaces:
IntCollection, IntContainer, Iterable<IntCursor>
- All Known Implementing Classes:
IntArrayDeque
@Generated(date="2024-05-16T08:18:11+0000",
value="KTypeDeque.java")
public interface IntDeque
extends IntCollection
A linear collection that supports element insertion and removal at both ends.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFirst(int e) Inserts the specified element at the front of this deque.voidaddLast(int e) Inserts the specified element at the end of this deque.<T extends IntPredicate>
TdescendingForEach(T predicate) Applies apredicateto container elements as long, as the predicate returnstrue.<T extends IntProcedure>
TdescendingForEach(T procedure) Applies aprocedureto all elements in tail-to-head order.intgetFirst()Retrieves the first element of this deque but does not remove it.intgetLast()Retrieves the last element of this deque but does not remove it.intRetrieves and removes the first element of this deque.intremoveFirst(int e) Removes the first element that equalse.intRetrieves and removes the last element of this deque.intremoveLast(int e) Removes the last element that equalse.Methods inherited from interface IntCollection
clear, release, removeAll, removeAll, removeAll, retainAll, retainAllMethods inherited from interface IntContainer
contains, forEach, forEach, isEmpty, iterator, size, toArrayMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
removeFirst
int removeFirst(int e) Removes the first element that equalse.- Returns:
- The deleted element's index or
-1if the element was not found.
-
removeLast
int removeLast(int e) Removes the last element that equalse.- Returns:
- The deleted element's index or
-1if the element was not found.
-
addFirst
void addFirst(int e) Inserts the specified element at the front of this deque. -
addLast
void addLast(int e) Inserts the specified element at the end of this deque. -
removeFirst
int removeFirst()Retrieves and removes the first element of this deque.- Returns:
- the head (first) element of this deque.
-
removeLast
int removeLast()Retrieves and removes the last element of this deque.- Returns:
- the tail of this deque.
-
getFirst
int getFirst()Retrieves the first element of this deque but does not remove it.- Returns:
- the head of this deque.
-
getLast
int getLast()Retrieves the last element of this deque but does not remove it.- Returns:
- the head of this deque.
-
descendingIterator
-
descendingForEach
Applies aprocedureto all elements in tail-to-head order. -
descendingForEach
Applies apredicateto container elements as long, as the predicate returnstrue. The iteration is interrupted otherwise.
-