Top Description Methods
com.carrotsearch.hppc

public Interface CharDeque

extends CharCollection
Known Direct Implementers
com.carrotsearch.hppc.CharArrayDeque
Annotations
@Generated:KTypeDeque.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.cursors.CharCursor, com.carrotsearch.hppc.predicates.CharPredicate, com.carrotsearch.hppc.procedures.CharProcedure, 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(char e)

Inserts the specified element at the front of this deque.

public void
addLast(char e)

Inserts the specified element at the end of this deque.

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

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

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

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

public Iterator<CharCursor>

Returns:

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

public char

Returns:

the head of this deque.
getFirst
()

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

public char

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

Removes the first element that equals e.

public char

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

Removes the last element that equals e.

public char

Returns:

the tail of this deque.
removeLast
()

Retrieves and removes the last element of this deque.

Inherited from com.carrotsearch.hppc.CharCollection:
clearreleaseremoveAllremoveAllremoveAllretainAllretainAll

Method Detail

addFirstback to summary
public void addFirst(char e)

Inserts the specified element at the front of this deque.

addLastback to summary
public void addLast(char e)

Inserts the specified element at the end of this deque.

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

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

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

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

getFirstback to summary
public char getFirst()

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

Returns:char

the head of this deque.

getLastback to summary
public char getLast()

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

Returns:char

the head of this deque.

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

Retrieves and removes the first element of this deque.

Returns:char

the head (first) element of this deque.

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

Retrieves and removes the last element of this deque.

Returns:char

the tail of this deque.