harpoon.Util
Interface Worklist

All Known Implementing Classes:
UniqueStack, WorkSet

public interface Worklist

A Worklist is a unique set.

Version:
$Id: Worklist.java,v 1.3 2002/02/25 21:08:56 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Method Summary
 boolean contains(Object item)
          Determines if the Worklist contains an item.
 boolean isEmpty()
          Determines if there are any more items left in the Worklist.
 Object pull()
          Removes some item from the Worklist and return it.
 void push(Object item)
          Pushes an item onto the Worklist if it is not already there.
 

Method Detail

push

public void push(Object item)
Pushes an item onto the Worklist if it is not already there.
modifies: this
effects: If item is not already an element of this, adds item to this. Else does nothing.


pull

public Object pull()
Removes some item from the Worklist and return it.
modifies: this
effects: If there exists an Object, item, that is an element of this, removes item from this and returns item. Else does nothing.


contains

public boolean contains(Object item)
Determines if the Worklist contains an item.
effects: If item is an element of this, returns true. Else returns false.


isEmpty

public boolean isEmpty()
Determines if there are any more items left in the Worklist.
effects: If this has any elements, returns true. Else returns false.