package com.carrotsearch.hppc;
import java.util.Deque;
import java.util.Iterator;
import com.carrotsearch.hppc.cursors.ObjectCursor;
import com.carrotsearch.hppc.predicates.ObjectPredicate;
import com.carrotsearch.hppc.procedures.ObjectProcedure;
A linear collection that supports element insertion and removal at both ends.
See Also: - Deque
/**
* A linear collection that supports element insertion and removal at both ends.
*
* @see Deque
*/
@com.carrotsearch.hppc.Generated(
date = "2018-05-21T12:24:05+0200",
value = "KTypeDeque.java")
public interface ObjectDeque<KType> extends ObjectCollection<KType> {
Removes the first element that equals e
.
Returns: The deleted element's index or -1
if the element
was not found.
/**
* Removes the first element that equals <code>e</code>.
*
* @return The deleted element's index or <code>-1</code> if the element
* was not found.
*/
public int removeFirst(KType e);
Removes the last element that equals e
.
Returns: The deleted element's index or -1
if the element
was not found.
/**
* Removes the last element that equals <code>e</code>.
*
* @return The deleted element's index or <code>-1</code> if the element
* was not found.
*/
public int removeLast(KType e);
Inserts the specified element at the front of this deque.
/**
* Inserts the specified element at the front of this deque.
*/
public void addFirst(KType e);
Inserts the specified element at the end of this deque.
/**
* Inserts the specified element at the end of this deque.
*/
public void addLast(KType e);
Retrieves and removes the first element of this deque.
Returns: the head (first) element of this deque.
/**
* Retrieves and removes the first element of this deque.
*
* @return the head (first) element of this deque.
*/
public KType removeFirst();
Retrieves and removes the last element of this deque.
Returns: the tail of this deque.
/**
* Retrieves and removes the last element of this deque.
*
* @return the tail of this deque.
*/
public KType removeLast();
Retrieves the first element of this deque but does not remove it.
Returns: the head of this deque.
/**
* Retrieves the first element of this deque but does not remove it.
*
* @return the head of this deque.
*/
public KType getFirst();
Retrieves the last element of this deque but does not remove it.
Returns: the head of this deque.
/**
* Retrieves the last element of this deque but does not remove it.
*
* @return the head of this deque.
*/
public KType getLast();
Returns: An iterator over elements in this deque in tail-to-head order.
/**
* @return An iterator over elements in this deque in tail-to-head order.
*/
public Iterator<ObjectCursor<KType>> descendingIterator();
Applies a procedure
to all elements in tail-to-head order.
/**
* Applies a <code>procedure</code> to all elements in tail-to-head order.
*/
public <T extends ObjectProcedure<? super KType>> T descendingForEach(T procedure);
Applies a predicate
to container elements as long, as the
predicate returns true
. The iteration is interrupted
otherwise.
/**
* Applies a <code>predicate</code> to container elements as long, as the
* predicate returns <code>true</code>. The iteration is interrupted
* otherwise.
*/
public <T extends ObjectPredicate<? super KType>> T descendingForEach(T predicate);
}