Package com.carrotsearch.hppc
Interface ByteDeque
- All Superinterfaces:
ByteCollection
,ByteContainer
,Iterable<ByteCursor>
- All Known Implementing Classes:
ByteArrayDeque
@Generated(date="2023-10-26T04:33:09+0000",
value="KTypeDeque.java")
public interface ByteDeque
extends ByteCollection
A linear collection that supports element insertion and removal at both ends.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFirst
(byte e) Inserts the specified element at the front of this deque.void
addLast
(byte e) Inserts the specified element at the end of this deque.<T extends ByteProcedure>
TdescendingForEach
(T procedure) Applies aprocedure
to all elements in tail-to-head order.byte
getFirst()
Retrieves the first element of this deque but does not remove it.byte
getLast()
Retrieves the last element of this deque but does not remove it.byte
Retrieves and removes the first element of this deque.int
removeFirst
(byte e) Removes the first element that equalse
.byte
Retrieves and removes the last element of this deque.int
removeLast
(byte e) Removes the last element that equalse
.Methods inherited from interface com.carrotsearch.hppc.ByteCollection
clear, release, removeAll, removeAll, removeAll, retainAll, retainAll
Methods inherited from interface com.carrotsearch.hppc.ByteContainer
contains, forEach, isEmpty, iterator, size, toArray
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
removeFirst
int removeFirst(byte e) Removes the first element that equalse
.- Returns:
- The deleted element's index or
-1
if the element was not found.
-
removeLast
int removeLast(byte e) Removes the last element that equalse
.- Returns:
- The deleted element's index or
-1
if the element was not found.
-
addFirst
void addFirst(byte e) Inserts the specified element at the front of this deque. -
addLast
void addLast(byte e) Inserts the specified element at the end of this deque. -
removeFirst
byte removeFirst()Retrieves and removes the first element of this deque.- Returns:
- the head (first) element of this deque.
-
removeLast
byte removeLast()Retrieves and removes the last element of this deque.- Returns:
- the tail of this deque.
-
getFirst
byte getFirst()Retrieves the first element of this deque but does not remove it.- Returns:
- the head of this deque.
-
getLast
byte getLast()Retrieves the last element of this deque but does not remove it.- Returns:
- the head of this deque.
-
descendingIterator
Iterator<ByteCursor> descendingIterator()- Returns:
- An iterator over elements in this deque in tail-to-head order.
-
descendingForEach
Applies aprocedure
to all elements in tail-to-head order. -
descendingForEach
Applies apredicate
to container elements as long, as the predicate returnstrue
. The iteration is interrupted otherwise.
-