net.sf.neem.impl
Class Queue

java.lang.Object
  extended by net.sf.neem.impl.Queue

public class Queue
extends java.lang.Object

Implementation of a FIFO queue with random purging.


Field Summary
 int max
           
 
Constructor Summary
Queue(int max, java.util.Random random)
          Creates a new queue.
 
Method Summary
 boolean isEmpty()
           
 Queued pop()
          Retrieves (dequeues) an Object from this queue.
 void push(Queued o)
          Inserts (enqueues) an Object to this queue.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

max

public int max
Constructor Detail

Queue

public Queue(int max,
             java.util.Random random)
Creates a new queue.

Parameters:
max - The maximum number of elements this queue can hold.
random -
Method Detail

push

public void push(Queued o)
Inserts (enqueues) an Object to this queue.

Parameters:
o - The object to be enqueued.

pop

public Queued pop()
Retrieves (dequeues) an Object from this queue.

Returns:
The object to be dequeued.

isEmpty

public boolean isEmpty()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2005 University of Minho, Portugal. All Rights Reserved.