Author: mvw
Date: 2008-04-25 10:37:09-0700
New Revision: 14468

Modified:
   trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java
   trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java
   trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java
   trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java

Log:
Improved verbosity.

Modified: trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java?view=diff&rev=14468&p1=trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java&r1=14467&r2=14468
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java (original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/Agency.java 2008-04-25 
10:37:09-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -362,11 +362,14 @@
      * Compute which critics should be active (i.e., they can be
      * applied by applyAllCritics) for a given Designer. <p>
      *
-     * TODO: I am setting global data, the
+     * Note: I am setting global data, i.e. the
      * isEnabled bit in each critic, based on the needs of one designer.
      * I don't really support more than one Designer.
+     * Which is why each designer 
+     * (if we would support more than one designer) 
+     * has his own Agency.
      *
-     * TODO: should loop over simpler vector of critics, not CompoundCritics
+     * TODO: should loop over simpler list of critics, not CompoundCritics
      *
      * @param d the designer
      */

Modified: trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java?view=diff&rev=14468&p1=trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java&r1=14467&r2=14468
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java       
(original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/Designer.java       
2008-04-25 10:37:09-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -55,11 +55,15 @@
  *
  * Currently (almost) everything is hardcoded. What can be configurable??<p>
  *
- * The ToDoList is dependent on this class.<p>
+ * The ToDoList is dependent on this class, 
+ * i.e. each designer has its ToDoList.<p>
+ * 
+ * Each designer has his own Agency, 
+ * which is the only class that knows all the critics.<p>
  *
  * This class listens to property changes from ...?<p>
  *
- * A Designer can as well create ToDO Items, such as critics do. Hence he
+ * A designer can create ToDo Items, just like the critics. Hence the designer
  * implements the Poster interface.<p>
  *
  * TODO: There is a strong dependency cycle between Agency and Designer.  They

Modified: trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java?view=diff&rev=14468&p1=trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java&r1=14467&r2=14468
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java     
(original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/StandardCM.java     
2008-04-25 10:37:09-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -25,7 +25,6 @@
 package org.argouml.cognitive;
 
 import java.util.ArrayList;
-import java.util.Enumeration;
 import java.util.List;
 import java.util.Vector;
 
@@ -40,8 +39,16 @@
  * </ul>
  *
  * implying that a critic is relevant if and if only it is enabled, not 
snoozed,
- * applicable to the current goals and relevant decisions to be supported.
- *
+ * applicable to the current goals and relevant decisions to be supported.<p>
+ * 
+ * Mech is short for Mechanism. 
+ * A Control Mechanism is a structured way 
+ * to calculate a single condition from multiple different unrelated ones. 
+ * In the case of a StandardCM, 
+ * the single condition holds if we are enabled, 
+ * and not snoozed, 
+ * and fulfill designgoals, 
+ * and the designer is interested in these decisions.
  */
 public class StandardCM extends AndCM {
 
@@ -133,9 +140,7 @@
      * @see 
org.argouml.cognitive.critics.ControlMech#isRelevant(org.argouml.cognitive.critics.Critic,
 org.argouml.cognitive.Designer)
      */
     public boolean isRelevant(Critic c, Designer d) {
-        Enumeration cur = getMechs().elements();
-        while (cur.hasMoreElements()) {
-            ControlMech cm = (ControlMech) cur.nextElement();
+        for (ControlMech cm : getMechList()) {
             if (!cm.isRelevant(c, d)) {
                 return false;
             }
@@ -149,9 +154,7 @@
      * @see 
org.argouml.cognitive.critics.ControlMech#isRelevant(org.argouml.cognitive.critics.Critic,
 org.argouml.cognitive.Designer)
      */
     public boolean isRelevant(Critic c, Designer d) {
-        Enumeration cur = getMechs().elements();
-        while (cur.hasMoreElements()) {
-            ControlMech cm = (ControlMech) cur.nextElement();
+        for (ControlMech cm : getMechList()) {
             if (cm.isRelevant(c, d)) {
                 return true;
             }

Modified: trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java?view=diff&rev=14468&p1=trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java&p2=trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java&r1=14467&r2=14468
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java       
(original)
+++ trunk/src/argouml-app/src/org/argouml/cognitive/ToDoItem.java       
2008-04-25 10:37:09-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -112,7 +112,8 @@
      * common supertype for these three types, we can't type this list. We
      * should introduce a common supertype/interface. - tfm 20070630
      * <p>
-     * This is set by the constructor and cannot change.
+     * The list of offenders is set once (e.g. by the constructor)
+     * and cannot change.
      * <p>
      */
     private ListSet theOffenders;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to