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

com.carrotsearch.hppc.DoubleDeque Maven / Gradle / Ivy

Go to download

High Performance Primitive Collections: data structures (maps, sets, lists, stacks, queues) generated for combinations of object and primitive types to conserve JVM memory and speed up execution.

There is a newer version: 0.10.0
Show newest version
package com.carrotsearch.hppc;

import java.util.Deque;
import java.util.Iterator;

import com.carrotsearch.hppc.cursors.DoubleCursor;
import com.carrotsearch.hppc.predicates.DoublePredicate;
import com.carrotsearch.hppc.procedures.DoubleProcedure;

/**
 * A linear collection that supports element insertion and removal at both ends.
 * 
 * @see Deque
 */
 @com.carrotsearch.hppc.Generated(
    date = "2021-06-08T13:12:53+0200",
    value = "KTypeDeque.java") 
public interface DoubleDeque extends DoubleCollection {
  /**
   * Removes the first element that equals e.
   * 
   * @return The deleted element's index or -1 if the element
   *         was not found.
   */
  public int removeFirst(double e);

  /**
   * Removes the last element that equals e.
   * 
   * @return The deleted element's index or -1 if the element
   *         was not found.
   */
  public int removeLast(double e);

  /**
   * Inserts the specified element at the front of this deque.
   */
  public void addFirst(double e);

  /**
   * Inserts the specified element at the end of this deque.
   */
  public void addLast(double e);

  /**
   * Retrieves and removes the first element of this deque.
   *
   * @return the head (first) element of this deque.
   */
  public double removeFirst();

  /**
   * Retrieves and removes the last element of this deque.
   *
   * @return the tail of this deque.
   */
  public double removeLast();

  /**
   * Retrieves the first element of this deque but does not remove it.
   *
   * @return the head of this deque.
   */
  public double getFirst();

  /**
   * Retrieves the last element of this deque but does not remove it.
   *
   * @return the head of this deque.
   */
  public double getLast();

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

  /**
   * Applies a procedure to all elements in tail-to-head order.
   */
  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