All Packages Class Hierarchy This Package Previous Next Index
Interface Queue
- public abstract interface Queue
- extends Cloneable
- See Also:
- Stack
-
clone()
- Returns a shallow copy of the queue.
-
elements()
- Returns an enumeration of the elements in the queue.
-
firstElement()
- Returns the first element of the queue without removing the
element.
-
insertFirst(Object)
- Insert the specified element into the front of the queue.
-
insertLast(Object)
- Insert the specified element into the back of the queue.
-
lastElement()
- Returns the last element of the queue without removing the
element.
-
removeFirst()
- Remove and return an element from the front of the queue.
-
removeLast()
- Remove and return an element from the back of the queue.
-
size()
- Returns the number of elements in the queue.
lastElement
public abstract Object lastElement() throws NoSuchElementException
- Returns the last element of the queue without removing the
element.
- Returns:
- the last element
firstElement
public abstract Object firstElement() throws NoSuchElementException
- Returns the first element of the queue without removing the
element.
- Returns:
- the first element
insertFirst
public abstract void insertFirst(Object elem)
- Insert the specified element into the front of the queue.
- Parameters:
- elem - element to be inserted
insertLast
public abstract void insertLast(Object elem)
- Insert the specified element into the back of the queue.
- Parameters:
- elem - element to be inserted
removeFirst
public abstract Object removeFirst() throws NoSuchElementException
- Remove and return an element from the front of the queue.
- Returns:
- the element at the front of the queue
- Throws: NoSuchElementException
- thrown when there are no
elements in the queue
removeLast
public abstract Object removeLast() throws NoSuchElementException
- Remove and return an element from the back of the queue.
- Returns:
- the element at the back of the queue
- Throws: NoSuchElementException
- thrown when there are no
elements in the queue
size
public abstract int size()
- Returns the number of elements in the queue.
elements
public abstract Enumeration elements()
- Returns an enumeration of the elements in the queue.
- Returns:
- the enumeration
- See Also:
- Enumeration
clone
public abstract Object clone()
- Returns a shallow copy of the queue.
- Overrides:
- clone in class Object
- See Also:
- clone
All Packages Class Hierarchy This Package Previous Next Index