All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jdsl.simple.api.Queue

public interface Queue
Interface for a queue.

A queue is a collection of elements that are inserted and removed according to the first-in first-out principle.

Version:
$Revision: 1.2 $, $Date: 1998/07/02 21:24:43 $
Author:
Michael T. Goodrich, Natasha Gelfand, Mark Handy, Roberto Tamassia
See Also:
QueueEmptyException, Stack, Deque

Method Index

 o dequeue()
Remove the element at the front.
 o enqueue(Object)
Insert an element at the rear.
 o front()
Inspect the element at the front, without removing it or otherwise changing the queue.
 o isEmpty()
Return true if and only if the queue is empty.
 o size()
Return the number of elements.

Methods

 o size
 public abstract int size()
Return the number of elements.

Returns:
number of elements in the queue.
 o isEmpty
 public abstract boolean isEmpty()
Return true if and only if the queue is empty.

Returns:
true if the queue is empty, false otherwise.
 o front
 public abstract Object front() throws QueueEmptyException
Inspect the element at the front, without removing it or otherwise changing the queue.

Returns:
element at the front of the queue
Throws: QueueEmptyException
if the queue is empty
 o enqueue
 public abstract void enqueue(Object element)
Insert an element at the rear.

Parameters:
element - new element to be inserted.
 o dequeue
 public abstract Object dequeue() throws QueueEmptyException
Remove the element at the front.

Returns:
element removed.

All Packages  Class Hierarchy  This Package  Previous  Next  Index