org.argouml.cognitive.checklist
Class CheckManager

java.lang.Object
  |
  +--org.argouml.cognitive.checklist.CheckManager
All Implemented Interfaces:
java.io.Serializable

public class CheckManager
extends java.lang.Object
implements java.io.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 java.util.Hashtable _Lists
          List of checklists.
private static java.util.Hashtable _Statuses
          List of ChecklistStatus:es.
 
Constructor Summary
CheckManager()
           
 
Method Summary
static Checklist getChecklistFor(java.lang.Object dm)
          Gets the checklist for an element.
static ChecklistStatus getStatusFor(java.lang.Object dm)
          Get the ChecklistStatus for some object.
private static Checklist lookupChecklist(java.lang.Class cls)
          Find an element in the list.
static void register(java.lang.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 java.util.Hashtable _Lists
List of checklists. Indexed on the object type of the element that this checklist is appropriate for.


_Statuses

private static java.util.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()
Method Detail

getChecklistFor

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

Parameters:
dm - is the element
Returns:
a checklist

lookupChecklist

private static Checklist lookupChecklist(java.lang.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.

register

public static void register(java.lang.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(java.lang.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 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook