Top Description Methods
com.carrotsearch.hppc

public Interface ShortDeque

extends ShortCollection
Known Direct Implementers
com.carrotsearch.hppc.ShortArrayDeque
Annotations
@Generated:KTypeDeque.java
date:2024-06-04T15:20:17+0200
Imports
com.carrotsearch.hppc.cursors.ShortCursor, com.carrotsearch.hppc.predicates.ShortPredicate, com.carrotsearch.hppc.procedures.ShortProcedure, 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(short e)

Inserts the specified element at the front of this deque.

public void
addLast(short e)

Inserts the specified element at the end of this deque.

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

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

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

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

public Iterator<ShortCursor>

Returns:

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

public short

Returns:

the head of this deque.
getFirst
()

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

public short

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

Removes the first element that equals e.

public short

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

Removes the last element that equals e.

public short

Returns:

the tail of this deque.
removeLast
()

Retrieves and removes the last element of this deque.

Inherited from com.carrotsearch.hppc.ShortCollection:
clearreleaseremoveAllremoveAllremoveAllretainAllretainAll

Method Detail

addFirstback to summary
public void addFirst(short e)

Inserts the specified element at the front of this deque.

addLastback to summary
public void addLast(short e)

Inserts the specified element at the end of this deque.

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

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

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

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

getFirstback to summary
public short getFirst()

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

Returns:short

the head of this deque.

getLastback to summary
public short getLast()

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

Returns:short

the head of this deque.

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

Retrieves and removes the first element of this deque.

Returns:short

the head (first) element of this deque.

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

Retrieves and removes the last element of this deque.

Returns:short

the tail of this deque.