org.cementj.collect
Class Queue

java.lang.Object
  extended by org.cementj.collect.Queue

public class Queue
extends java.lang.Object

A classic implementation of a queue. The JDK provides an implementation of a Stack, but not a queue. This queue also allows the prioritization of queue contents.

Copyright: Delta Vortex Technologies, 2002.


Field Summary
static int MAX_PRIORITY
           
static int MIN_PRIORITY
           
static int NORM_PRIORITY
           
 
Constructor Summary
Queue()
           
Queue(java.util.Collection c)
           
Queue(int initialCapacity)
           
 
Method Summary
 boolean empty()
          Tests if Queue is empty.
 java.lang.Object peek()
          Provides the next object on the Queue without removing it.
 java.lang.Object pop()
          Removes the next object on the Queue and provides it to the caller.
 java.lang.Object push(java.lang.Object obj)
          Adds an object to the Queue
 java.lang.Object push(java.lang.Object obj, int priority)
          Adds an object to the Queue
 int size()
          Provides size of Queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORM_PRIORITY

public static final int NORM_PRIORITY
See Also:
Constant Field Values

MIN_PRIORITY

public static final int MIN_PRIORITY
See Also:
Constant Field Values

MAX_PRIORITY

public static final int MAX_PRIORITY
See Also:
Constant Field Values
Constructor Detail

Queue

public Queue()

Queue

public Queue(java.util.Collection c)

Queue

public Queue(int initialCapacity)
Method Detail

empty

public boolean empty()
Tests if Queue is empty.


size

public int size()
Provides size of Queue.


peek

public java.lang.Object peek()
Provides the next object on the Queue without removing it.


push

public java.lang.Object push(java.lang.Object obj)
Adds an object to the Queue


push

public java.lang.Object push(java.lang.Object obj,
                             int priority)
Adds an object to the Queue


pop

public java.lang.Object pop()
Removes the next object on the Queue and provides it to the caller.



Copyright © 2003 Delta Vortex Technologies, Inc. All Rights Reserved.