All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.carrotsearch.hppcrt.IntDeque Maven / Gradle / Ivy

Go to download

High Performance Primitive Collections Realtime (fork of HPPC from Carrotsearch) Fundamental data structures (maps, sets, lists, queues, heaps, sorts) generated for combinations of object and primitive types to conserve JVM memory and speed up execution. The Realtime fork intends to extend the existing collections, by tweaking to remove any dynamic allocations at runtime, and to obtain low variance execution times whatever the input nature.

The newest version!
package com.carrotsearch.hppcrt;

import java.util.Iterator;
import java.util.List;

import com.carrotsearch.hppcrt.cursors.*;
import com.carrotsearch.hppcrt.predicates.*;
import com.carrotsearch.hppcrt.procedures.*;

/**
 * A double-sided queue of ints.
 */
 @javax.annotation.Generated(
    date = "2017-07-11T19:16:23+0200",
    value = "KTypeDeque.java") 
public interface IntDeque extends IntCollection
{
    /**
     * Removes the first element that equals e1, returning its
     * deleted position or -1 if the element was not found.
     */
    public int removeFirst(int e1);

    /**
     * Removes the last element that equals e1, returning its
     * deleted position or -1 if the element was not found.
     */
    public int removeLast(int e1);

    /**
     * Inserts the specified element at the front of this deque.
     *
     * @param e1 the element to add
     */
    public void addFirst(int e1);

    /**
     * Inserts the specified element at the end of this deque.
     *
     * @param e1 the element to add
     */
    public void addLast(int e1);

    /**
     * Retrieves and removes the first element of this deque.
     * Precondition : the deque is not empty !
     * @return the head element of this deque.
     * @throws AssertionError if this deque is empty and assertions are enabled.
     */
    public int removeFirst();

    /**
     * Retrieves and removes the last element of this deque.
     * Precondition : the deque is not empty !
     * @return the tail of this deque.
     * @throws AssertionError if this deque is empty and assertions are enabled.
     */
    public int removeLast();

    /**
     * Retrieves, but does not remove, the first element of this deque.
     * Precondition : the deque is not empty !
     * @return the head of this deque.
     * @throws AssertionError if this deque is empty and assertions are enabled.
     */
    public int getFirst();

    /**
     * Retrieves, but does not remove, the last element of this deque.
     * Precondition : the deque is not empty !
     * @return the tail of this deque.
     * @throws AssertionError if this deque is empty and assertions are enabled.
     */
    public int getLast();

    /**
     * @return An iterator over elements in this deque in tail-to-head order.
     */
    public Iterator descendingIterator();

    /**
     * Applies a procedure to all container elements.
     */
    public  T descendingForEach(T procedure);

    /**
     * Applies a predicate to container elements as long, as the predicate
     * returns true. The iteration is interrupted otherwise.
     */
    public  T descendingForEach(T predicate);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy