Top Description Methods
com.carrotsearch.hppc

public Interface LongDeque

extends LongCollection
Known Direct Implementers
com.carrotsearch.hppc.LongArrayDeque
Annotations
@Generated:KTypeDeque.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.cursors.LongCursor, com.carrotsearch.hppc.predicates.LongPredicate, com.carrotsearch.hppc.procedures.LongProcedure, java.util.Deque, .Iterator

A linear collection that supports element insertion and removal at both ends.
See Also
Deque

Method Summary

Modifier and TypeMethod and Description
public void
addFirst(long e)

Inserts the specified element at the front of this deque.

public void
addLast(long e)

Inserts the specified element at the end of this deque.

public <T extends LongProcedure> T
descendingForEach(T procedure)

Applies a procedure to all elements in tail-to-head order.

public <T extends LongPredicate> T
descendingForEach(T predicate)

Applies a predicate to container elements as long, as the predicate returns true.

public Iterator<LongCursor>

Returns:

An iterator over elements in this deque in tail-to-head order.
descendingIterator
()

public long

Returns:

the head of this deque.
getFirst
()

Retrieves the first element of this deque but does not remove it.

public long

Returns:

the head of this deque.
getLast
()

Retrieves the last element of this deque but does not remove it.

public int

Returns:

The deleted element's index or -1 if the element was not found.
removeFirst
(long e)

Removes the first element that equals e.

public long

Returns:

the head (first) element of this deque.
removeFirst
()

Retrieves and removes the first element of this deque.

public int

Returns:

The deleted element's index or -1 if the element was not found.
removeLast
(long e)

Removes the last element that equals e.

public long

Returns:

the tail of this deque.
removeLast
()

Retrieves and removes the last element of this deque.

Inherited from com.carrotsearch.hppc.LongCollection:
clearreleaseremoveAllremoveAllremoveAllretainAllretainAll

Method Detail

addFirstback to summary
public void addFirst(long e)

Inserts the specified element at the front of this deque.

addLastback to summary
public void addLast(long e)

Inserts the specified element at the end of this deque.

descendingForEachback to summary
public <T extends LongProcedure> T descendingForEach(T procedure)

Applies a procedure to all elements in tail-to-head order.

descendingForEachback to summary
public <T extends LongPredicate> T descendingForEach(T predicate)

Applies a predicate to container elements as long, as the predicate returns true. The iteration is interrupted otherwise.

descendingIteratorback to summary
public Iterator<LongCursor> descendingIterator()
Returns:Iterator<LongCursor>

An iterator over elements in this deque in tail-to-head order.

getFirstback to summary
public long getFirst()

Retrieves the first element of this deque but does not remove it.

Returns:long

the head of this deque.

getLastback to summary
public long getLast()

Retrieves the last element of this deque but does not remove it.

Returns:long

the head of this deque.

removeFirstback to summary
public int removeFirst(long e)

Removes the first element that equals e.

Returns:int

The deleted element's index or -1 if the element was not found.

removeFirstback to summary
public long removeFirst()

Retrieves and removes the first element of this deque.

Returns:long

the head (first) element of this deque.

removeLastback to summary
public int removeLast(long e)

Removes the last element that equals e.

Returns:int

The deleted element's index or -1 if the element was not found.

removeLastback to summary
public long removeLast()

Retrieves and removes the last element of this deque.

Returns:long

the tail of this deque.