com.carrotsearch.hppc
Interface FloatDeque

All Superinterfaces:
FloatCollection, FloatContainer, java.lang.Iterable<FloatCursor>
All Known Implementing Classes:
FloatArrayDeque

@Generated(date="2011-11-28T23:36:05+0000",
           value="HPPC generated from: FloatDeque.java")
public interface FloatDeque
extends FloatCollection

A double-linked queue of floats.


Method Summary
 void addFirst(float e1)
          Inserts the specified element at the front of this deque.
 void addLast(float e1)
          Inserts the specified element at the end of this deque.
<T extends FloatPredicate>
T
descendingForEach(T predicate)
          Applies a predicate to container elements as long, as the predicate returns true.
<T extends FloatProcedure>
T
descendingForEach(T procedure)
          Applies a procedure to all container elements.
 java.util.Iterator<FloatCursor> descendingIterator()
           
 boolean equals(java.lang.Object obj)
          Compares the specified object with this deque for equality.
 float getFirst()
          Retrieves, but does not remove, the first element of this deque.
 float getLast()
          Retrieves, but does not remove, the last element of this deque.
 int hashCode()
           
 float removeFirst()
          Retrieves and removes the first element of this deque.
 int removeFirstOccurrence(float e1)
          Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.
 float removeLast()
          Retrieves and removes the last element of this deque.
 int removeLastOccurrence(float e1)
          Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.
 
Methods inherited from interface com.carrotsearch.hppc.FloatCollection
clear, removeAll, removeAll, removeAllOccurrences, retainAll, retainAll
 
Methods inherited from interface com.carrotsearch.hppc.FloatContainer
contains, forEach, forEach, isEmpty, iterator, size, toArray
 

Method Detail

removeFirstOccurrence

int removeFirstOccurrence(float e1)
Removes the first element that equals e1, returning its deleted position or -1 if the element was not found.


removeLastOccurrence

int removeLastOccurrence(float e1)
Removes the last element that equals e1, returning its deleted position or -1 if the element was not found.


addFirst

void addFirst(float e1)
Inserts the specified element at the front of this deque.

Parameters:
e1 - the element to add

addLast

void addLast(float e1)
Inserts the specified element at the end of this deque.

Parameters:
e1 - the element to add

removeFirst

float removeFirst()
Retrieves and removes the first element of this deque.

Returns:
the head element of this deque.
Throws:
java.lang.AssertionError - if this deque is empty and assertions are enabled.

removeLast

float removeLast()
Retrieves and removes the last element of this deque.

Returns:
the tail of this deque.
Throws:
java.lang.AssertionError - if this deque is empty and assertions are enabled.

getFirst

float getFirst()
Retrieves, but does not remove, the first element of this deque.

Returns:
the head of this deque.
Throws:
java.lang.AssertionError - if this deque is empty and assertions are enabled.

getLast

float getLast()
Retrieves, but does not remove, the last element of this deque.

Returns:
the tail of this deque.
Throws:
java.lang.AssertionError - if this deque is empty and assertions are enabled.

descendingIterator

java.util.Iterator<FloatCursor> descendingIterator()
Returns:
An iterator over elements in this deque in tail-to-head order.

descendingForEach

<T extends FloatProcedure> T descendingForEach(T procedure)
Applies a procedure to all container elements.


descendingForEach

<T extends FloatPredicate> T descendingForEach(T predicate)
Applies a predicate to container elements as long, as the predicate returns true. The iteration is interrupted otherwise.


equals

boolean equals(java.lang.Object obj)
Compares the specified object with this deque for equality. Returns true if and only if the specified object is also a ObjectDeque, and all corresponding pairs of elements acquired from forward iterators are the same. In other words, two indexed containers are defined to be equal if they contain the same elements in the same order of iteration.

Note that, unlike in List, deques may be of different types and still return true from equals(java.lang.Object). This may be dangerous if you use different hash functions in two containers, but don't override the default implementation of equals(java.lang.Object). It is the programmer's responsibility to enforcing these contracts properly.

Overrides:
equals in class java.lang.Object

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
A hash code of elements stored in the deque. The hash code is defined identically to List.hashCode() (should be implemented with the same algorithm), replacing forward index loop with a forward iterator loop.


Copyright © 2011 Carrot Search s.c.. All Rights Reserved.