Top Description Methods
com.carrotsearch.hppc

public Interface ByteDeque

extends ByteCollection
Known Direct Implementers
com.carrotsearch.hppc.ByteArrayDeque
Annotations
@Generated:KTypeDeque.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.cursors.ByteCursor, com.carrotsearch.hppc.predicates.BytePredicate, com.carrotsearch.hppc.procedures.ByteProcedure, 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(byte e)

Inserts the specified element at the front of this deque.

public void
addLast(byte e)

Inserts the specified element at the end of this deque.

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

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

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

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

public Iterator<ByteCursor>

Returns:

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

public byte

Returns:

the head of this deque.
getFirst
()

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

public byte

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
(byte e)

Removes the first element that equals e.

public byte

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
(byte e)

Removes the last element that equals e.

public byte

Returns:

the tail of this deque.
removeLast
()

Retrieves and removes the last element of this deque.

Inherited from com.carrotsearch.hppc.ByteCollection:
clearreleaseremoveAllremoveAllremoveAllretainAllretainAll

Method Detail

addFirstback to summary
public void addFirst(byte e)

Inserts the specified element at the front of this deque.

addLastback to summary
public void addLast(byte e)

Inserts the specified element at the end of this deque.

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

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

descendingForEachback to summary
public <T extends BytePredicate> 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<ByteCursor> descendingIterator()
Returns:Iterator<ByteCursor>

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

getFirstback to summary
public byte getFirst()

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

Returns:byte

the head of this deque.

getLastback to summary
public byte getLast()

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

Returns:byte

the head of this deque.

removeFirstback to summary
public int removeFirst(byte 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 byte removeFirst()

Retrieves and removes the first element of this deque.

Returns:byte

the head (first) element of this deque.

removeLastback to summary
public int removeLast(byte 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 byte removeLast()

Retrieves and removes the last element of this deque.

Returns:byte

the tail of this deque.