All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.Util.UniqueFIFO

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

public class UniqueFIFO
extends FIFO
implements Worklist
The UniqueFIFO class represents a first-in-first-out list of unique objects.

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

Constructor Index

 o UniqueFIFO()

Method Index

 o contains(Object)
Determines whether this fifo contains an object.
 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, if it is unique.

Constructors

 o UniqueFIFO
 public UniqueFIFO()

Methods

 o contains
 public boolean contains(Object item)
Determines whether this fifo contains an object.

Returns:
true if the fifo contains item, false otherwise.
 o push
 public synchronized Object push(Object item)
Pushes an item onto the front of this fifo, if it is unique. Otherwise, does nothing.

Parameters:
item - the item to be pushed onto this stack.
Returns:
the item argument.
Overrides:
push in class FIFO
 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.
Overrides:
pull in class FIFO
 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.
Overrides:
peek in class FIFO

All Packages  Class Hierarchy  This Package  Previous  Next  Index