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>
-
UniqueFIFO()
-
-
contains(Object)
- Determines whether this fifo contains an object.
-
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, if it is unique.
UniqueFIFO
public UniqueFIFO()
contains
public boolean contains(Object item)
- Determines whether this fifo contains an object.
- Returns:
-
true
if the fifo contains item
,
false
otherwise.
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
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
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