Class Queue

java.lang.Object
  |
  +--Queue

public class Queue
extends java.lang.Object

This class is an array implementation of the fifo queue used in SmartSolvedWeb matching.

Version:
1.0
Author:
t.karhunen, i.lassila

Constructor Summary
Queue(int size)
           
 
Method Summary
 void add(int value)
          Adds a value to the tail of the Queue
 int getNext()
          Gets (and removes) the value at the head of the Queue
 boolean isEmpty()
          Checks if the Queue is empty
 void replace(int a, int b)
          Replaces instances of a with b in the Queue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue(int size)
Method Detail

isEmpty

public boolean isEmpty()
Checks if the Queue is empty
Returns:
true, if the Queue is empty

add

public void add(int value)
Adds a value to the tail of the Queue
Parameters:
value - the value to be added

getNext

public int getNext()
Gets (and removes) the value at the head of the Queue
Returns:
the value at the head of the Queue

replace

public void replace(int a,
                    int b)
Replaces instances of a with b in the Queue
Parameters:
a - the value to be replaced
b - the value to replace a