ConditionalController.java
01 /*
02  *  Copyright (c) 1995-2010, The University of Sheffield. See the file
03  *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
04  *
05  *  This file is part of GATE (see http://gate.ac.uk/), and is free
06  *  software, licenced under the GNU Library General Public License,
07  *  Version 2, June 1991 (in the distribution as file licence.html,
08  *  and also available at http://gate.ac.uk/gate/licence.html).
09  *
10  *  Valentin Tablan 11 Apr 2002
11  *
12  *  $Id: ConditionalController.java 12006 2009-12-01 17:24:28Z thomas_heitz $
13  */
14 
15 package gate.creole;
16 
17 import java.util.Collection;
18 
19 import gate.Controller;
20 
21 /**
22  * A Conditional controller is a controller that keeps a running strategy for
23  * each PR contained. The running strategy decides whether a particular PR will
24  * be run or not.
25  */
26 
27 public interface ConditionalController extends Controller{
28 
29   /**
30    * Gets the collection of running strategies for the contained PRs.
31    * The iterator of this collection should return the running strategies in
32    * sync with the iterator for the getPRs() method of {@link Controller}.
33    @return a Collection object.
34    */
35   public Collection getRunningStrategies();
36 
37   /**
38    * Populates this controller with the appropiate running strategies from a
39    * collection of running strategies
40    * (optional operation).
41    *
42    * Controllers that are serializable must implement this method needed by GATE
43    * to restore their contents.
44    @throws UnsupportedOperationException if the <tt>setPRs</tt> method
45    *          is not supported by this controller.
46    */
47   public void setRunningStrategies(Collection strategies);
48 }