nextElement

Returns the next element from the Dequeue. Calls to this method will enumerate successive elements.

Specified by:

nextElement in interface java.util.Enumeration

Returns:

the next element

Throws:

java.util.NoSuchElementException - If no more elements exist.

hasNext

public boolean hasNext()

Tests if this Iterator contains more elements.

Specified by:

hasNext in interface java.util.Iterator

Returns:

true if the Iterator contains more elements, false otherwise

next

public java.lang.Object next()

Returns the next element of this Iterator.

Specified by:

next in interface java.util.Iterator

Returns:

the next element in the Iterator

remove

public void remove()

Remove the last-returned element that was returned by the Iterator. This method always throws UnsupportedOperationException because the Iterator is immutable.

Specified by:

remove in interface java.util.Iterator

addElement

public void addElement(java.lang.Object o)

Adds an element to the dequeue. The passed object is placed at the end of the dequeue.

Parameters:

o - object to add to the Dequeue

putBackElement

public void putBackElement(java.lang.Object o)

Returns the most recently returned element to the Dequeue. After calling this method, a call to nextElement will return the element that was returned by the most recent call to nextElement. This method can be called multiple times to put back multiple elements.

Throws:

java.util.NoSuchElementException - If the element that is being put back is no longer in the Dequeue.

removeAllElements

public void removeAllElements()

Removes all items from the dequeue.

capacity

public int capacity()

Determine the current capacity of this dequeue.

Returns:

the current capacity of this dequeue

size

public int size()

Determine the current number of objects in this dequeue.

Returns:

the current number of objects in this dequeue

isEmpty

public boolean isEmpty()

Determines if the dequeue is empty.

Returns:

true if the dequeue is empty, false otherwise

isFull

public boolean isFull()

Determines if the dequeue is full. This method is mainly of use internally, since the dequeue auto-resizes when additional items are added.

Returns:

true if the dequeue is full, false otherwise

clone

public java.lang.Object clone()

Creates a clone of the dequeue.

Returns:

the clone

next

protected int next(int i)

Determines the index following the passed index for storing or accessing an item from the m_ao storage.

Returns:

the next index

prev

protected int prev(int i)

Determines the index preceding the passed index for storing or accessing an item from the m_ao storage.