All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.Util.FIFO

java.lang.Object
   |
   +----harpoon.Util.FIFO

public class FIFO
extends Object
The FIFO class represents a first-in-first-out list of objects.

Version:
$Id: FIFO.java,v 1.4 1998/10/11 03:01:18 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Index

 o FIFO()

Method Index

 o copyInto(Object[])
Copies contents of a FIFO into an array.
 o elements()
Returns an enumeration of the contents of the FIFO.
 o isEmpty()
Tests if this stack is empty.
 o peek()
Looks at the object at the back of this fifo without removing it.
 o pull()
Removes the object at the back of this fifo and returns that object as the value of this function.
 o push(Object)
Pushes an item onto the front of this fifo.

Constructors

 o FIFO
 public FIFO()

Methods

 o push
 public synchronized Object push(Object item)
Pushes an item onto the front of this fifo.

Parameters:
item - the item to be pushed onto this stack.
Returns:
the item argument.
 o pull
 public synchronized Object pull()
Removes the object at the back of this fifo and returns that object as the value of this function.

Returns:
The object at the end of the fifo.
Throws: EmptyStackException
if this fifo is empty.
 o peek
 public synchronized Object peek()
Looks at the object at the back of this fifo without removing it.

Returns:
the object at the end of this fifo.
Throws: EmptyStackException
if this fifo is empty.
 o isEmpty
 public boolean isEmpty()
Tests if this stack is empty.

Returns:
true if this stack is empty; false otherwise.
 o copyInto
 public void copyInto(Object oa[])
Copies contents of a FIFO into an array.

 o elements
 public Enumeration elements()
Returns an enumeration of the contents of the FIFO.


All Packages  Class Hierarchy  This Package  Previous  Next  Index