giden.GRDS
Class Queue

java.lang.Object
  |
  +--giden.GRDS.Queue
Direct Known Subclasses:
BoundedQueue

public class Queue
extends java.lang.Object

Copyright (c) 1993-2004 C. R. Coullard, D. S. Dilworth, J. H. Owen, All Rights Reserved.
We make no representations or warranties about the suitability of the software, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. We shall not be liable for any damages suffered by user as a result of using, modifying or distributing this software or its derivatives.

Queue is a first-in first-out data structure that is based on a LinkList. Objects are removed from the queue in the same order that they were added to the queue.

Copyright (c) 1993-2003 C. R. Coullard, D. S. Dilworth, J. H. Owen, All Rights Reserved.

Version:
4.0a 2004 08 27
Author:
D. S. Dilworth
See Also:
Network, PQList, BoundedQueue

Constructor Summary
Queue()
          Creates a queue
 
Method Summary
 void Append(java.lang.Object object)
          Appends the object to the end of this queue
 void DeleteContents()
          Deletes the contents of this queue
 int GetSize()
          Gets the number of elements in this queue
 java.lang.Object GetTop()
          Gets the object at the top of this queue without delete
 boolean IsEmpty()
          Tests if this queue is empty
 java.lang.Object Pop()
          Gets the object at the top of this queue with delete
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
Creates a queue
Method Detail

GetTop

public java.lang.Object GetTop()
Gets the object at the top of this queue without delete
Returns:
The top object. Note this object probably needs to be cast into another type of data structure.

Pop

public java.lang.Object Pop()
Gets the object at the top of this queue with delete
Returns:
The top object. Note this object probably needs to be cast into another type of data structure.

Append

public void Append(java.lang.Object object)
Appends the object to the end of this queue

GetSize

public int GetSize()
Gets the number of elements in this queue
Returns:
The size of this queue

IsEmpty

public boolean IsEmpty()
Tests if this queue is empty
Returns:
True if the queue is empty, else false

DeleteContents

public void DeleteContents()
Deletes the contents of this queue