de.rwth.dfa
Class StackWorklist

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--java.util.Stack
                          |
                          +--de.rwth.dfa.StackWorklist
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable, Worklist

public class StackWorklist
extends java.util.Stack
implements Worklist

A work list implementation using stacks.

  1. The last recently added element is retrieved.
  2. Elements are stored just once.

Version:
$Id: StackWorklist.java,v 1.2 2002/09/17 06:53:53 mohnen Exp $
Author:
Markus Mohnen
See Also:
Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
StackWorklist()
          Creates a new StackWorklist instance.
 
Method Summary
 boolean add(java.lang.Object o)
          Adds a new element on top of the stack.
 java.lang.Object get()
          Gets the last recently added element.
 void moveToFront(java.lang.Object o)
          Moves the element to the top of this stack.
 
Methods inherited from class java.util.Stack
empty, peek, pop, push, search
 
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.rwth.dfa.Worklist
isEmpty, size
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

StackWorklist

public StackWorklist()
Creates a new StackWorklist instance.
Method Detail

add

public boolean add(java.lang.Object o)
Adds a new element on top of the stack. Does not add the element if its already stored.
Specified by:
add in interface Worklist
Overrides:
add in class java.util.Vector
Parameters:
o - an Object value
Returns:
a boolean value

get

public java.lang.Object get()
                     throws java.util.NoSuchElementException
Gets the last recently added element.
Specified by:
get in interface Worklist
Returns:
an Object value
Throws:
java.util.NoSuchElementException - if an error occurs

moveToFront

public void moveToFront(java.lang.Object o)
                 throws java.util.NoSuchElementException
Moves the element to the top of this stack.
Specified by:
moveToFront in interface Worklist
Parameters:
o - an Object value
Throws:
java.util.NoSuchElementException - if an error occurs