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>
-
FIFO()
-
-
copyInto(Object[])
- Copies contents of a FIFO into an array.
-
elements()
- Returns an enumeration of the contents of the FIFO.
-
isEmpty()
- Tests if this stack is empty.
-
peek()
- Looks at the object at the back of this fifo without removing it.
-
pull()
- Removes the object at the back of this fifo and returns that
object as the value of this function.
-
push(Object)
-
Pushes an item onto the front of this fifo.
FIFO
public FIFO()
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.
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.
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.
isEmpty
public boolean isEmpty()
- Tests if this stack is empty.
- Returns:
-
true
if this stack is empty;
false
otherwise.
copyInto
public void copyInto(Object oa[])
- Copies contents of a FIFO into an array.
elements
public Enumeration elements()
- Returns an enumeration of the contents of the FIFO.
All Packages Class Hierarchy This Package Previous Next Index