public class ArrayFIFO extends Object
| Constructor and Description |
|---|
ArrayFIFO()
Constructs an empty array deque with an initial capacity
sufficient to hold 16 elements.
|
ArrayFIFO(int numElements)
Constructs an empty array deque with an initial capacity
sufficient to hold the specified number of elements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFirst(Object e)
Inserts the specified element at the front of this deque.
|
void |
addLast(Object e)
Inserts the specified element at the end of this deque.
|
void |
clear()
Removes all of the elements from this deque.
|
boolean |
isEmpty()
Returns true if this deque contains no elements.
|
Object |
peek()
Looks at the object at the top of this stack without removing it
from the stack.
|
Object |
peekFirst() |
Object |
peekLast() |
Object |
pollFirst() |
Object |
pollLast() |
Object |
pop()
Pops an element from the stack represented by this deque.
|
void |
push(Object e)
Pushes an element onto the stack represented by this deque.
|
boolean |
remove(Object o)
Removes the first occurrence of the specified element in this
deque (when traversing the deque from head to tail).
|
int |
size()
Returns the number of elements in this deque.
|
public ArrayFIFO()
public ArrayFIFO(int numElements)
numElements - lower bound on initial capacity of the dequepublic void addFirst(Object e)
e - the element to addNullPointerException - if the specified element is nullpublic void addLast(Object e)
This method is equivalent to #add.
e - the element to addNullPointerException - if the specified element is nullpublic Object pollFirst()
public Object pollLast()
public Object peekFirst()
public Object peekLast()
public void push(Object e)
e - the element to pushNullPointerException - if the specified element is nullpublic Object pop()
null if no element available.public Object peek()
public int size()
public boolean isEmpty()
public void clear()
public boolean remove(Object o)
o - element to be removed from this deque, if presentCopyright © 2004-2013 Cosylab. All Rights Reserved.