Revision: 17548
          http://sourceforge.net/p/gate/code/17548
Author:   markagreenwood
Date:     2014-03-05 21:21:05 +0000 (Wed, 05 Mar 2014)
Log Message:
-----------
this really is the final set for this evening....... honest :)

Modified Paths:
--------------
    gate/trunk/src/main/gate/creole/ConditionalController.java
    gate/trunk/src/main/gate/creole/ConditionalSerialController.java
    gate/trunk/src/main/gate/gui/NameBearerHandle.java

Modified: gate/trunk/src/main/gate/creole/ConditionalController.java
===================================================================
--- gate/trunk/src/main/gate/creole/ConditionalController.java  2014-03-05 
21:08:10 UTC (rev 17547)
+++ gate/trunk/src/main/gate/creole/ConditionalController.java  2014-03-05 
21:21:05 UTC (rev 17548)
@@ -14,10 +14,10 @@
 
 package gate.creole;
 
+import gate.Controller;
+
 import java.util.Collection;
 
-import gate.Controller;
-
 /**
  * A Conditional controller is a controller that keeps a running strategy for
  * each PR contained. The running strategy decides whether a particular PR will
@@ -32,7 +32,7 @@
    * sync with the iterator for the getPRs() method of {@link Controller}.
    * @return a Collection object.
    */
-  public Collection getRunningStrategies();
+  public Collection<RunningStrategy> getRunningStrategies();
 
   /**
    * Populates this controller with the appropiate running strategies from a
@@ -44,5 +44,5 @@
    * @throws UnsupportedOperationException if the <tt>setPRs</tt> method
    *          is not supported by this controller.
    */
-  public void setRunningStrategies(Collection strategies);
+  public void setRunningStrategies(Collection<RunningStrategy> strategies);
 }
\ No newline at end of file

Modified: gate/trunk/src/main/gate/creole/ConditionalSerialController.java
===================================================================
--- gate/trunk/src/main/gate/creole/ConditionalSerialController.java    
2014-03-05 21:08:10 UTC (rev 17547)
+++ gate/trunk/src/main/gate/creole/ConditionalSerialController.java    
2014-03-05 21:21:05 UTC (rev 17548)
@@ -38,11 +38,11 @@
                                          implements ConditionalController{
 
   public ConditionalSerialController(){
-    strategiesList = new ArrayList();
+    strategiesList = new ArrayList<RunningStrategy>();
   }
 
   @Override
-  public Collection getRunningStrategies(){
+  public Collection<RunningStrategy> getRunningStrategies(){
     return Collections.unmodifiableList(strategiesList);
   }
 
@@ -118,9 +118,9 @@
    *          is not supported by this controller.
    */
   @Override
-  public void setRunningStrategies(Collection strategies){
+  public void setRunningStrategies(Collection<RunningStrategy> strategies){
     strategiesList.clear();
-    Iterator stratIter = strategies.iterator();
+    Iterator<RunningStrategy> stratIter = strategies.iterator();
     while(stratIter.hasNext()) strategiesList.add(stratIter.next());
   }
 
@@ -153,7 +153,7 @@
 
 
     //run the thing
-    if(((RunningStrategy)strategiesList.get(componentIndex)).shouldRun()){
+    if(strategiesList.get(componentIndex).shouldRun()){
       benchmarkFeatures.put(Benchmark.PR_NAME_FEATURE, currentPR.getName());
 
       long startTime = System.currentTimeMillis();
@@ -236,5 +236,5 @@
   /**
    * The list of running strategies for the member PRs.
    */
-  protected List strategiesList;
+  protected List<RunningStrategy> strategiesList;
 } // class SerialController

Modified: gate/trunk/src/main/gate/gui/NameBearerHandle.java
===================================================================
--- gate/trunk/src/main/gate/gui/NameBearerHandle.java  2014-03-05 21:08:10 UTC 
(rev 17547)
+++ gate/trunk/src/main/gate/gui/NameBearerHandle.java  2014-03-05 21:21:05 UTC 
(rev 17548)
@@ -37,6 +37,7 @@
 import gate.creole.ConditionalSerialAnalyserController;
 import gate.creole.ResourceData;
 import gate.creole.ResourceInstantiationException;
+import gate.creole.RunningStrategy;
 import gate.creole.SerialAnalyserController;
 import gate.creole.ir.DefaultIndexDefinition;
 import gate.creole.ir.DocumentContentReader;
@@ -549,8 +550,8 @@
         List<ProcessingResource> empty = Collections.emptyList();
         ((Controller)target).setPRs(empty);
         if(target instanceof ConditionalController) {
-          ((ConditionalController)target).setRunningStrategies(Collections
-                  .emptyList());
+          List<RunningStrategy> emptyRS = Collections.emptyList();
+          ((ConditionalController)target).setRunningStrategies(emptyRS);
         }
       }
       if(target instanceof Resource) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to