ArrayDeque (Java Platform SE 7 ) (original) (raw)

Modifier and Type

Method and Description

boolean

**[add](../../java/util/ArrayDeque.html#add%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the end of this deque.

void

**[addFirst](../../java/util/ArrayDeque.html#addFirst%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the front of this deque.

void

**[addLast](../../java/util/ArrayDeque.html#addLast%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the end of this deque.

void

**[clear](../../java/util/ArrayDeque.html#clear%28%29)**()

Removes all of the elements from this deque.

[ArrayDeque](../../java/util/ArrayDeque.html "class in java.util")<[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")>

**[clone](../../java/util/ArrayDeque.html#clone%28%29)**()

Returns a copy of this deque.

boolean

**[contains](../../java/util/ArrayDeque.html#contains%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Returns

true

if this deque contains the specified element.

[Iterator](../../java/util/Iterator.html "interface in java.util")<[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")>

**[descendingIterator](../../java/util/ArrayDeque.html#descendingIterator%28%29)**()

Returns an iterator over the elements in this deque in reverse sequential order.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[element](../../java/util/ArrayDeque.html#element%28%29)**()

Retrieves, but does not remove, the head of the queue represented by this deque.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[getFirst](../../java/util/ArrayDeque.html#getFirst%28%29)**()

Retrieves, but does not remove, the first element of this deque.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[getLast](../../java/util/ArrayDeque.html#getLast%28%29)**()

Retrieves, but does not remove, the last element of this deque.

boolean

**[isEmpty](../../java/util/ArrayDeque.html#isEmpty%28%29)**()

Returns

true

if this deque contains no elements.

[Iterator](../../java/util/Iterator.html "interface in java.util")<[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")>

**[iterator](../../java/util/ArrayDeque.html#iterator%28%29)**()

Returns an iterator over the elements in this deque.

boolean

**[offer](../../java/util/ArrayDeque.html#offer%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the end of this deque.

boolean

**[offerFirst](../../java/util/ArrayDeque.html#offerFirst%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the front of this deque.

boolean

**[offerLast](../../java/util/ArrayDeque.html#offerLast%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Inserts the specified element at the end of this deque.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[peek](../../java/util/ArrayDeque.html#peek%28%29)**()

Retrieves, but does not remove, the head of the queue represented by this deque, or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[peekFirst](../../java/util/ArrayDeque.html#peekFirst%28%29)**()

Retrieves, but does not remove, the first element of this deque, or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[peekLast](../../java/util/ArrayDeque.html#peekLast%28%29)**()

Retrieves, but does not remove, the last element of this deque, or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[poll](../../java/util/ArrayDeque.html#poll%28%29)**()

Retrieves and removes the head of the queue represented by this deque (in other words, the first element of this deque), or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[pollFirst](../../java/util/ArrayDeque.html#pollFirst%28%29)**()

Retrieves and removes the first element of this deque, or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[pollLast](../../java/util/ArrayDeque.html#pollLast%28%29)**()

Retrieves and removes the last element of this deque, or returns

null

if this deque is empty.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[pop](../../java/util/ArrayDeque.html#pop%28%29)**()

Pops an element from the stack represented by this deque.

void

**[push](../../java/util/ArrayDeque.html#push%28E%29)**([E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque") e)

Pushes an element onto the stack represented by this deque.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[remove](../../java/util/ArrayDeque.html#remove%28%29)**()

Retrieves and removes the head of the queue represented by this deque.

boolean

**[remove](../../java/util/ArrayDeque.html#remove%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes a single instance of the specified element from this deque.

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[removeFirst](../../java/util/ArrayDeque.html#removeFirst%28%29)**()

Retrieves and removes the first element of this deque.

boolean

**[removeFirstOccurrence](../../java/util/ArrayDeque.html#removeFirstOccurrence%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes the first occurrence of the specified element in this deque (when traversing the deque from head to tail).

[E](../../java/util/ArrayDeque.html "type parameter in ArrayDeque")

**[removeLast](../../java/util/ArrayDeque.html#removeLast%28%29)**()

Retrieves and removes the last element of this deque.

boolean

**[removeLastOccurrence](../../java/util/ArrayDeque.html#removeLastOccurrence%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes the last occurrence of the specified element in this deque (when traversing the deque from head to tail).

int

**[size](../../java/util/ArrayDeque.html#size%28%29)**()

Returns the number of elements in this deque.

[Object](../../java/lang/Object.html "class in java.lang")[]

**[toArray](../../java/util/ArrayDeque.html#toArray%28%29)**()

Returns an array containing all of the elements in this deque in proper sequence (from first to last element).

<T> T[]

**[toArray](../../java/util/ArrayDeque.html#toArray%28T[]%29)**(T[] a)

Returns an array containing all of the elements in this deque in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.