KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > scalagent > scheduler > Condition


1 /*
2  * Copyright (C) 2001 - 2005 ScalAgent Distributed Technologies
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA.
18  *
19  * Initial developer(s): ScalAgent Distributed Technologies
20  * Contributor(s):
21  */

22 package com.scalagent.scheduler;
23
24 import fr.dyade.aaa.agent.*;
25
26
27 /**
28  * Notification changing the status of a starting condition of a
29  * <code>Task</code> agent.
30  *
31  * @see Task
32  */

33 public class Condition extends Notification {
34   /** condition name, may be null */
35   public String JavaDoc name;
36   /** condition status */
37   public boolean status;
38
39   /**
40    * Constructor.
41    *
42    * @param name condition name, may be null
43    * @param status condition status
44    */

45   public Condition(String JavaDoc name, boolean status) {
46     this.name = name;
47     this.status = status;
48   }
49
50   /**
51    * Constructor with default true status.
52    *
53    * @param name condition name, may be null
54    */

55   public Condition(String JavaDoc name) {
56     this(name, true);
57   }
58
59   /**
60    * Constructor with default null name.
61    *
62    * @param status condition status
63    */

64   public Condition(boolean status) {
65     this(null, status);
66   }
67
68   /**
69    * Constructor with default null name and true status.
70    */

71   public Condition() {
72     this(null, true);
73   }
74
75   
76   /**
77    * Provides a string image for this object.
78    *
79    * @result string image for this object
80    */

81   public StringBuffer JavaDoc toString(StringBuffer JavaDoc output) {
82     output.append('(');
83     output.append(super.toString(output));
84     output.append(",name=");
85     output.append(name);
86     output.append(",status=");
87     output.append(status);
88     output.append(')');
89     return output;
90   }
91 }
92
Popular Tags