Class Queue

Class Queue

java.lang.Object
   |
   +----java.util.Vector
           |
           +----Queue

public class Queue
extends Vector
This class abstracts a Queue data structure, that is a first-in, first-out or FIFO list of objects.

Constructor Index

 o Queue()

Method Index

 o add(Object)
This method puts an object at the back of the Queue.
 o empty()
Tests whether the Queue is empty
 o peek()
Look at the object at the front of the queue without removing it
 o remove()
This method takes the object from the front of the Queue.

Constructors

 o Queue
  public Queue()

Methods

 o add
  public void add(Object o)
This method puts an object at the back of the Queue.
Parameters:
o - The object to be added to the back of the Queue
 o remove
  public Object remove()
This method takes the object from the front of the Queue.
Returns:
The object at the front of the Queue
 o peek
  public Object peek()
Look at the object at the front of the queue without removing it
Returns:
the object at the front of the Queue
 o empty
  public boolean empty()
Tests whether the Queue is empty
Returns:
true if the Queue is empty, otherwise false