OGS Java API Spec

ogs.support
Class Queue

java.lang.Object
  |
  +--ogs.support.Queue

public class Queue
extends Object

A first-in, first-out (FIFO) data structure.


Constructor Summary
Queue()
          Create an empty queue.
 
Method Summary
 void add(Object object)
          Add an object to the end of this queue.
 void clear()
          Remove all entries from this queue.
 boolean contains(Object object)
          Determine if an entry is already in this queue.
 boolean isEmpty()
          Determine if this queue is empty.
 Object look()
          Access the object at the front of this queue.
 Object remove()
          Remove an object from the front of this queue.
 int size()
          Determine the number of elements in this queue.
 Object[] toArray()
          Convert this queue into an array of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
Create an empty queue.

Method Detail

isEmpty

public boolean isEmpty()
Determine if this queue is empty.

Returns:
True if the queue is empty.

size

public int size()
Determine the number of elements in this queue.

Returns:
Number of elements in this queue.

contains

public boolean contains(Object object)
Determine if an entry is already in this queue.

Parameters:
object - The object to look for.

add

public void add(Object object)
Add an object to the end of this queue.


remove

public Object remove()
Remove an object from the front of this queue.

Returns:
Object at the front of this queue.

look

public Object look()
Access the object at the front of this queue. The object is not removed from this queue.

Returns:
Object at the front of this queue.

clear

public void clear()
Remove all entries from this queue.


toArray

public Object[] toArray()
Convert this queue into an array of objects.


OGS Java API Spec