Package com.carrotsearch.hppc
Interface DoubleDeque
-
- All Superinterfaces:
DoubleCollection
,DoubleContainer
,java.lang.Iterable<DoubleCursor>
- All Known Implementing Classes:
DoubleArrayDeque
@Generated(date="2021-05-28T03:45:41+0000", value="KTypeDeque.java") public interface DoubleDeque extends DoubleCollection
A linear collection that supports element insertion and removal at both ends.- See Also:
Deque
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFirst(double e)
Inserts the specified element at the front of this deque.void
addLast(double e)
Inserts the specified element at the end of this deque.<T extends DoubleProcedure>
TdescendingForEach(T procedure)
Applies aprocedure
to all elements in tail-to-head order.java.util.Iterator<DoubleCursor>
descendingIterator()
double
getFirst()
Retrieves the first element of this deque but does not remove it.double
getLast()
Retrieves the last element of this deque but does not remove it.double
removeFirst()
Retrieves and removes the first element of this deque.int
removeFirst(double e)
Removes the first element that equalse
.double
removeLast()
Retrieves and removes the last element of this deque.int
removeLast(double e)
Removes the last element that equalse
.-
Methods inherited from interface com.carrotsearch.hppc.DoubleCollection
clear, release, removeAll, removeAll, removeAll, retainAll, retainAll
-
-
-
-
Method Detail
-
removeFirst
int removeFirst(double e)
Removes the first element that equalse
.- Returns:
- The deleted element's index or
-1
if the element was not found.
-
removeLast
int removeLast(double e)
Removes the last element that equalse
.- Returns:
- The deleted element's index or
-1
if the element was not found.
-
addFirst
void addFirst(double e)
Inserts the specified element at the front of this deque.
-
addLast
void addLast(double e)
Inserts the specified element at the end of this deque.
-
removeFirst
double removeFirst()
Retrieves and removes the first element of this deque.- Returns:
- the head (first) element of this deque.
-
removeLast
double removeLast()
Retrieves and removes the last element of this deque.- Returns:
- the tail of this deque.
-
getFirst
double getFirst()
Retrieves the first element of this deque but does not remove it.- Returns:
- the head of this deque.
-
getLast
double getLast()
Retrieves the last element of this deque but does not remove it.- Returns:
- the head of this deque.
-
descendingIterator
java.util.Iterator<DoubleCursor> descendingIterator()
- Returns:
- An iterator over elements in this deque in tail-to-head order.
-
descendingForEach
<T extends DoubleProcedure> T descendingForEach(T procedure)
Applies aprocedure
to all elements in tail-to-head order.
-
descendingForEach
<T extends DoublePredicate> T descendingForEach(T predicate)
Applies apredicate
to container elements as long, as the predicate returnstrue
. The iteration is interrupted otherwise.
-
-