org.argouml.cognitive.checklist
Class CheckManager

java.lang.Object
  extended byorg.argouml.cognitive.checklist.CheckManager
All Implemented Interfaces:
Serializable

public class CheckManager
extends Object
implements Serializable

The CheckManager keeps track of which Checklists should be presented for a given design material. CheckManager also keeps track of which CheckItem's are checked off for a given design element.

See Also:
Serialized Form

Field Summary
private static Hashtable lists
          List of checklists.
private static Hashtable statuses
          List of ChecklistStatus:es.
 
Constructor Summary
CheckManager()
          Constructor.
 
Method Summary
static Checklist getChecklistFor(Object dm)
          Gets the checklist for an element.
static ChecklistStatus getStatusFor(Object dm)
          Get the ChecklistStatus for some object.
private static Checklist lookupChecklist(Class cls)
          Find an element in the list.
static void register(Object dm, Checklist cl)
          Registers a new list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lists

private static Hashtable lists
List of checklists. Indexed on the object type of the element that this checklist is appropriate for.


statuses

private static Hashtable statuses
List of ChecklistStatus:es. Indexed on the model element itself. TODO: Should use weak references so that this is forgotten about when the object is removed.

Constructor Detail

CheckManager

public CheckManager()
Constructor.

Method Detail

getChecklistFor

public static Checklist getChecklistFor(Object dm)
Gets the checklist for an element.

Parameters:
dm - is the element
Returns:
a checklist

lookupChecklist

private static Checklist lookupChecklist(Class cls)
Find an element in the list. This is a little more complex than the simple lookup since it might be that we are indexing with a class and the list contains interfaces. Since the hashtable lookup is a lot faster than the linear search we add the result of the linear search to the hashtable so that the next time we need not do it.

Parameters:
cls - the class to lookup.
Returns:
Checklist or null if noone exist.

register

public static void register(Object dm,
                            Checklist cl)
Registers a new list. Used when setting up the checklist stuff.

Parameters:
dm - the class for which the Checklist holds
cl - the Checklist

getStatusFor

public static ChecklistStatus getStatusFor(Object dm)
Get the ChecklistStatus for some object. If there is none, then create one.

Parameters:
dm - is the object that we retrieve the checklist for
Returns:
ChecklistStatus, a half filled list.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook