|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Generated(date="2011-07-12T16:58:49+0200", value="HPPC generated from: ObjectDeque.java") public interface ObjectDeque<KType>
A double-linked queue of KType
s.
Method Summary | ||
---|---|---|
void |
addFirst(KType e1)
Inserts the specified element at the front of this deque. |
|
void |
addLast(KType e1)
Inserts the specified element at the end of this deque. |
|
|
descendingForEach(T predicate)
Applies a predicate to container elements as long, as the predicate
returns true . |
|
|
descendingForEach(T procedure)
Applies a procedure to all container elements. |
|
java.util.Iterator<ObjectCursor<KType>> |
descendingIterator()
|
|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this deque for equality. |
|
KType |
getFirst()
Retrieves, but does not remove, the first element of this deque. |
|
KType |
getLast()
Retrieves, but does not remove, the last element of this deque. |
|
int |
hashCode()
|
|
KType |
removeFirst()
Retrieves and removes the first element of this deque. |
|
int |
removeFirstOccurrence(KType e1)
Removes the first element that equals e1 , returning its
deleted position or -1 if the element was not found. |
|
KType |
removeLast()
Retrieves and removes the last element of this deque. |
|
int |
removeLastOccurrence(KType 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.ObjectCollection |
---|
clear, removeAll, removeAll, removeAllOccurrences, retainAll, retainAll |
Methods inherited from interface com.carrotsearch.hppc.ObjectContainer |
---|
contains, forEach, forEach, isEmpty, iterator, size, toArray, toArray |
Method Detail |
---|
int removeFirstOccurrence(KType e1)
e1
, returning its
deleted position or -1
if the element was not found.
int removeLastOccurrence(KType e1)
e1
, returning its
deleted position or -1
if the element was not found.
void addFirst(KType e1)
e1
- the element to addvoid addLast(KType e1)
e1
- the element to addKType removeFirst()
java.lang.AssertionError
- if this deque is empty and assertions are enabled.KType removeLast()
java.lang.AssertionError
- if this deque is empty and assertions are enabled.KType getFirst()
java.lang.AssertionError
- if this deque is empty and assertions are enabled.KType getLast()
java.lang.AssertionError
- if this deque is empty and assertions are enabled.java.util.Iterator<ObjectCursor<KType>> descendingIterator()
<T extends ObjectProcedure<? super KType>> T descendingForEach(T procedure)
procedure
to all container elements.
<T extends ObjectPredicate<? super KType>> T descendingForEach(T predicate)
predicate
to container elements as long, as the predicate
returns true
. The iteration is interrupted otherwise.
boolean equals(java.lang.Object obj)
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.
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object
List.hashCode()
(should be implemented
with the same algorithm), replacing forward index loop with a forward iterator
loop.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |