All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.core.Queue

java.lang.Object
   |
   +----weka.core.Queue

public class Queue
extends Object
implements Serializable
Class representing a FIFO queue.

Version:
$Revision: 1.2 $
Author:
Len Trigg (trigg@cs.waikato.ac.nz)

Constructor Index

 o Queue()

Method Index

 o empty()
Checks if queue is empty.
 o main(String[])
Main method for testing this class.
 o peek()
Gets object from the front of the queue.
 o pop()
Pops an object from the front of the queue.
 o push(Object)
Appends an object to the back of the queue.
 o removeAllElements()
Removes all objects from the queue.
 o size()
Gets queue's size.
 o toString()
Produces textual description of queue.

Constructors

 o Queue
 public Queue()

Methods

 o removeAllElements
 public final synchronized void removeAllElements()
Removes all objects from the queue.

 o push
 public synchronized Object push(Object item)
Appends an object to the back of the queue.

Parameters:
item - the object to be appended
Returns:
the object appended
 o pop
 public synchronized Object pop() throws Exception
Pops an object from the front of the queue.

Returns:
the object at the front of the queue
Throws: Exception
if the queue is empty
 o peek
 public synchronized Object peek() throws Exception
Gets object from the front of the queue.

Returns:
the object at the front of the queue
Throws: Exception
if the queue is empty
 o empty
 public boolean empty()
Checks if queue is empty.

Returns:
true if queue is empty
 o size
 public int size()
Gets queue's size.

Returns:
size of queue
 o toString
 public String toString()
Produces textual description of queue.

Returns:
textual description of queue
Overrides:
toString in class Object
 o main
 public static void main(String argv[])
Main method for testing this class.

Parameters:
argv - a set of strings that are pushed on a test queue

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home