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
_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
ToDoList
public ToDoList()
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