- All Superinterfaces:
CharCollection,CharContainer,Iterable<CharCursor>
- All Known Implementing Classes:
CharArrayDeque
@Generated(date="2024-06-04T15:20:17+0200",
value="KTypeDeque.java")
public interface CharDeque
extends CharCollection
A linear collection that supports element insertion and removal at both ends.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFirst(char e) Inserts the specified element at the front of this deque.voidaddLast(char e) Inserts the specified element at the end of this deque.<T extends CharProcedure>
TdescendingForEach(T procedure) Applies aprocedureto all elements in tail-to-head order.chargetFirst()Retrieves the first element of this deque but does not remove it.chargetLast()Retrieves the last element of this deque but does not remove it.charRetrieves and removes the first element of this deque.intremoveFirst(char e) Removes the first element that equalse.charRetrieves and removes the last element of this deque.intremoveLast(char e) Removes the last element that equalse.Methods inherited from interface com.carrotsearch.hppc.CharCollection
clear, release, removeAll, removeAll, removeAll, retainAll, retainAllMethods inherited from interface com.carrotsearch.hppc.CharContainer
contains, forEach, isEmpty, iterator, size, toArrayMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
removeFirst
int removeFirst(char e) Removes the first element that equalse.- Returns:
- The deleted element's index or
-1if the element was not found.
-
removeLast
int removeLast(char e) Removes the last element that equalse.- Returns:
- The deleted element's index or
-1if the element was not found.
-
addFirst
void addFirst(char e) Inserts the specified element at the front of this deque. -
addLast
void addLast(char e) Inserts the specified element at the end of this deque. -
removeFirst
char removeFirst()Retrieves and removes the first element of this deque.- Returns:
- the head (first) element of this deque.
-
removeLast
char removeLast()Retrieves and removes the last element of this deque.- Returns:
- the tail of this deque.
-
getFirst
char getFirst()Retrieves the first element of this deque but does not remove it.- Returns:
- the head of this deque.
-
getLast
char getLast()Retrieves the last element of this deque but does not remove it.- Returns:
- the head of this deque.
-
descendingIterator
Iterator<CharCursor> descendingIterator()- Returns:
- An iterator over elements in this deque in tail-to-head order.
-
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.
-