KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > jmx > config > Operation


1 package org.sapia.soto.jmx.config;
2
3 import org.sapia.soto.util.Utils;
4
5 import java.util.ArrayList JavaDoc;
6 import java.util.List JavaDoc;
7
8
9 /**
10  * @author Yanick Duchesne
11  * 19-Aug-2003
12  * <dl>
13  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
14  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
15  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
16  * </dl>
17  */

18 public class Operation {
19   private String JavaDoc _name;
20   private String JavaDoc _description;
21   private String JavaDoc[] _sig;
22   private List JavaDoc _params = new ArrayList JavaDoc();
23
24   /**
25    * Constructor for Operation.
26    */

27   public Operation() {
28     super();
29   }
30
31   public void setName(String JavaDoc name) {
32     _name = name;
33   }
34
35   String JavaDoc getName() {
36     return _name;
37   }
38
39   public void setDescription(String JavaDoc desc) {
40     _description = desc;
41   }
42
43   String JavaDoc getDescription() {
44     return _description;
45   }
46
47   public void setSig(String JavaDoc sig) {
48     _sig = Utils.split(sig, ',', true);
49   }
50
51   String JavaDoc[] getSig() {
52     return _sig;
53   }
54
55   public Param createParam() {
56     Param p = new Param();
57     _params.add(p);
58
59     return p;
60   }
61
62   List JavaDoc getParams() {
63     return _params;
64   }
65
66   public int hashCode() {
67     return _name.hashCode();
68   }
69
70   public boolean equals(Object JavaDoc other) {
71     try {
72       Operation op = (Operation) other;
73
74       return _name.equals(op._name);
75     } catch (ClassCastException JavaDoc e) {
76       return false;
77     }
78   }
79 }
80
Popular Tags