All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.tools.v2-0.Queue

java.lang.Object
   |
   +----com.roguewave.tools.v2-0.CollectionBase
           |
           +----com.roguewave.tools.v2-0.Slist
                   |
                   +----com.roguewave.tools.v2-0.Queue

public class Queue
extends Slist
implements Cloneable, Serializable
A First-In-First-Out (FIFO) queue of objects. A Queue is a sequential list for which all insertions are made at one end (via put()), but all removals are made from the other end (via get()). Duplicate entries are allowed.

Note that this class extends Slist and that you can use inherited methods such as isEmpty() and size().


Constructor Index

 o Queue()

Method Index

 o clone()
Returns a clone of this Queue.
 o get()
Returns and removes the element from the front of the queue.
 o peek()
Peeks at the front of the queue without removing the element there.
 o put(Object)
Puts an item onto the end of the queue.
 o search(Object)
Checks to see if there is an element in the queue which is equal to (equals()) the given item, and if so, returns its distance from the front of the queue.

Constructors

 o Queue
 public Queue()

Methods

 o clone
 public Object clone()
Returns a clone of this Queue. Note that the elements themselves are not cloned.

Overrides:
clone in class Slist
 o get
 public synchronized Object get()
Returns and removes the element from the front of the queue.

Throws: EmptyQueueException
If the queue is empty
 o peek
 public synchronized Object peek()
Peeks at the front of the queue without removing the element there.

Returns:
The object at the front of the queue
Throws: EmptyQueueException
If the queue is empty
 o put
 public Object put(Object item)
Puts an item onto the end of the queue.

Parameters:
item - the item to added to the queue
Returns:
The new element
 o search
 public int search(Object item)
Checks to see if there is an element in the queue which is equal to (equals()) the given item, and if so, returns its distance from the front of the queue.

Returns:
The distance from the front, or -1 if no such element is found.

All Packages  Class Hierarchy  This Package  Previous  Next  Index