uci.argo.kernel
Class ToDoList

java.lang.Object
  |
  +--java.util.Observable
        |
        +--uci.argo.kernel.ToDoList

public class ToDoList
extends Observable
implements Runnable, Serializable

This class implments a list of ToDoItem's. If desired it can also spwan a "sweeper" thread that periodically goes through the list and elimiates ToDoItem's that are no longer valid.

See Also:
jargo.ui.UiToDoList, Designer.nondisruptivelyWarn(uci.argo.kernel.ToDoItem), Serialized Form

Field Summary
protected  VectorSet _allKnowledgeTypes
           
protected  VectorSet _allOffenders
           
protected  VectorSet _allPosters
           
protected  Designer _designer
          The designer, used in determining if a ToDoItem is still valid.
protected  Vector _items
          Pending ToDoItems for the designer to consider.
protected  EventListenerList _listenerList
           
static int _longestToDoList
           
static int _numNotValid
           
protected static Object _RecentOffender
           
protected static Vector _RecentOffenderItems
           
protected  Vector _resolvedItems
          ToDoItems that the designer has explicitly indicated that (s)he considers resolved.
protected  Thread _validityChecker
          A Thread that keeps checking if the items on the list are still valid.
 
Constructor Summary
ToDoList()
           
 
Method Summary
 void addAll(ToDoList list)
           
 void addElement(ToDoItem item)
           
 void addToDoListListener(ToDoListListener l)
           
 ToDoItem elementAt(int index)
           
 Enumeration elements()
           
 Vector elementsForOffender(Object off)
           
 boolean explicitlyResolve(ToDoItem item, String reason)
           
protected  void fireToDoItemAdded(ToDoItem item)
           
protected  void fireToDoItemChanged(ToDoItem item)
           
protected  void fireToDoItemRemoved(ToDoItem item)
           
protected  void fireToDoItemsAdded(Vector items)
           
protected  void fireToDoItemsRemoved(Vector items)
           
protected  void fireToDoListChanged()
           
 void forceValidityCheck()
           
protected  void forceValidityCheck(Vector removes)
          Check each ToDoItem on the list to see if it is still valid.
 Vector getDecisions()
           
 Vector getGoals()
           
 VectorSet getKnowledgeTypes()
           
 VectorSet getOffenders()
           
 VectorSet getPosters()
           
 Vector getToDoItems()
           
 void notifyObservers()
           
 void notifyObservers(Object o)
           
 void notifyObservers(String action, Object arg)
           
protected  void recomputeAllKnowledgeTypes()
           
protected  void recomputeAllOffenders()
           
protected  void recomputeAllPosters()
           
 void removeAll(ToDoList list)
           
 void removeAllElements()
           
 boolean removeElement(ToDoItem item)
           
 void removeToDoListListener(ToDoListListener l)
           
 boolean resolve(ToDoItem item)
           
 void run()
          Periodically check to see if items on the list are still valid.
 int size()
           
 void spawnValidityChecker(Designer d)
          Start a Thread to delete old items from the ToDoList.
 String toString()
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_items

protected Vector _items
Pending ToDoItems for the designer to consider.

_allOffenders

protected VectorSet _allOffenders

_allKnowledgeTypes

protected VectorSet _allKnowledgeTypes

_allPosters

protected VectorSet _allPosters

_resolvedItems

protected Vector _resolvedItems
ToDoItems that the designer has explicitly indicated that (s)he considers resolved. Needs-More-Work: generalize into a design rationale logging facility.

_validityChecker

protected Thread _validityChecker
A Thread that keeps checking if the items on the list are still valid.

_designer

protected Designer _designer
The designer, used in determining if a ToDoItem is still valid.

_listenerList

protected EventListenerList _listenerList

_longestToDoList

public static int _longestToDoList

_numNotValid

public static int _numNotValid

_RecentOffender

protected static Object _RecentOffender

_RecentOffenderItems

protected static Vector _RecentOffenderItems
Constructor Detail

ToDoList

public ToDoList()
Method Detail

spawnValidityChecker

public void spawnValidityChecker(Designer d)
Start a Thread to delete old items from the ToDoList.

run

public void run()
Periodically check to see if items on the list are still valid.
Specified by:
run in interface Runnable

forceValidityCheck

public void forceValidityCheck()

forceValidityCheck

protected void forceValidityCheck(Vector removes)
Check each ToDoItem on the list to see if it is still valid. If not, then remove that item. This is called automatically by the ValidityCheckingThread, and it can be called by the user pressing a button via forceValidityCheck().

Warning: Fragile code! No method that this method calls can synchronized the Designer, otherwise there will be deadlock.


notifyObservers

public void notifyObservers(String action,
                            Object arg)

notifyObservers

public void notifyObservers(Object o)
Overrides:
notifyObservers in class Observable

notifyObservers

public void notifyObservers()
Overrides:
notifyObservers in class Observable

getToDoItems

public Vector getToDoItems()

getOffenders

public VectorSet getOffenders()

getDecisions

public Vector getDecisions()

getGoals

public Vector getGoals()

getKnowledgeTypes

public VectorSet getKnowledgeTypes()

getPosters

public VectorSet getPosters()

addElement

public void addElement(ToDoItem item)

addAll

public void addAll(ToDoList list)

removeAll

public void removeAll(ToDoList list)

removeElement

public boolean removeElement(ToDoItem item)

resolve

public boolean resolve(ToDoItem item)

explicitlyResolve

public boolean explicitlyResolve(ToDoItem item,
                                 String reason)

removeAllElements

public void removeAllElements()

elementsForOffender

public Vector elementsForOffender(Object off)

size

public int size()

elements

public Enumeration elements()

elementAt

public ToDoItem elementAt(int index)

recomputeAllOffenders

protected void recomputeAllOffenders()

recomputeAllKnowledgeTypes

protected void recomputeAllKnowledgeTypes()

recomputeAllPosters

protected void recomputeAllPosters()

addToDoListListener

public void addToDoListListener(ToDoListListener l)

removeToDoListListener

public void removeToDoListListener(ToDoListListener l)

fireToDoListChanged

protected void fireToDoListChanged()

fireToDoItemChanged

protected void fireToDoItemChanged(ToDoItem item)

fireToDoItemAdded

protected void fireToDoItemAdded(ToDoItem item)

fireToDoItemsAdded

protected void fireToDoItemsAdded(Vector items)

fireToDoItemRemoved

protected void fireToDoItemRemoved(ToDoItem item)

fireToDoItemsRemoved

protected void fireToDoItemsRemoved(Vector items)

toString

public String toString()
Overrides:
toString in class Object