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.
-
Queue()
-
-
add(Object)
- This method puts an object at the back of the Queue.
-
empty()
-
Tests whether the Queue is empty
-
peek()
-
Look at the object at the front of the queue without removing it
-
remove()
- This method takes the object from the front of the Queue.
Queue
public Queue()
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
remove
public Object remove()
- This method takes the object from the front of the Queue.
- Returns:
- The object at the front of the Queue
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
empty
public boolean empty()
- Tests whether the Queue is empty
- Returns:
- true if the Queue is empty, otherwise false