2006/unicorn/org/w3c/unicorn/tasklisttree TLTNode.java,1.5,1.6

Update of /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree
In directory hutz:/tmp/cvs-serv10640/org/w3c/unicorn/tasklisttree

Modified Files:
	TLTNode.java 
Log Message:
MimeTypes work again for DirectInput

Index: TLTNode.java
===================================================================
RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tasklisttree/TLTNode.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- TLTNode.java	26 Aug 2008 15:27:50 -0000	1.5
+++ TLTNode.java	19 Sep 2008 18:57:12 -0000	1.6
@@ -1,10 +1,13 @@
 package org.w3c.unicorn.tasklisttree;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.w3c.unicorn.contract.Observer;
+
 /**
  * Class made to manage the execution
  * of a tasklist. It can contain several TLTExec objects and
@@ -82,11 +85,33 @@
 	 * 
 	 * @return The list of executions
 	 */
-	public ArrayList<TLTExec> getExecutionList() {
+	public List<TLTExec> getExecutionList() {
 		TLTNode.logger.trace("getExecutionList");
 		return executionList;
 	}
 	
+    public List<Observer> getAllObservers() {
+        List<Observer> res = new ArrayList();
+        getAllObserversRec(res);
+        return res;
+    }
+
+    private void getAllObserversRec(List<Observer> res) {
+        // Add every observers directly under this TLTNode
+        for(TLTExec exec : this.executionList) {
+            Observer o = exec.getObserver();
+            if(!res.contains(o)) {
+                res.add(o);
+            }
+        }
+
+        // Recursively add observers in <if> elements
+        for(TLTIf ifNode : this.ifList) {
+            ifNode.getIfOk().getAllObserversRec(res);
+            ifNode.getIfNotOk().getAllObserversRec(res);
+        }
+    }
+
 	/**
 	 * 
 	 * @return The list of "ifs"

Received on Friday, 19 September 2008 18:57:49 UTC