KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > plugin > TimerDescription


1 /*
2  * CLIF is a Load Injection Framework
3  * Copyright (C) 2004 France Telecom R&D
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * CLIF
20  *
21  * Contact: clif@objectweb.org
22  */

23 package org.objectweb.clif.scenario.util.isac.plugin;
24
25 import org.apache.log4j.Category;
26 import org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription;
27
28 import java.util.*;
29 /**
30  * This class store a timer description
31  *
32  * @author JC Meillaud
33  * @author A Peyrard
34  */

35 public class TimerDescription implements ActionDescription {
36     static Category cat = Category
37             .getInstance(TimerDescription.class.getName());
38     private String JavaDoc name;
39     private String JavaDoc number;
40     private Vector params;
41     private Vector help;
42     private String JavaDoc guiKey;
43
44     /**
45      * Build a new timer description object, used to store information about a
46      * timer action
47      *
48      * @param n
49      * The name of the action
50      * @param nb
51      * The number of the timer in the object timer table
52      * @param p
53      * The parameters definitions
54      * @param h
55      * The help for this action
56      */

57     public TimerDescription(String JavaDoc n, String JavaDoc nb, Vector p, Vector h) {
58         cat.debug("-> constructor");
59         this.name = n;
60         this.number = nb;
61         this.params = p;
62         this.help = h;
63         this.guiKey = null;
64     }
65
66     /**
67      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#createNodeDescription(org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription)
68      */

69     public void createNodeDescription(NodeDescription desc) {
70         cat.debug("-> createNodeDescription");
71         desc.setActionName(this.name);
72         Hashtable paramsValues = new Hashtable();
73         for (int i = 0; i < this.params.size(); i++)
74             paramsValues.put(((ParameterDescription) this.params.elementAt(i))
75                     .getName(), "");
76         desc.setParams(paramsValues);
77     }
78
79     /**
80      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#getGUIKey()
81      */

82     public String JavaDoc getGUIKey() {
83         cat.debug("-> getGUIKey");
84         return guiKey;
85     }
86
87     /**
88      * @see org.objectweb.clif.scenario.util.isac.plugin.ActionDescription#setGUIKey(java.lang.String)
89      */

90     public void setGUIKey(String JavaDoc key) {
91         cat.debug("-> setGUIKey");
92         this.guiKey = key;
93     }
94     /**
95      * Attribute help getter
96      *
97      * @return The help of the action
98      */

99     public Vector getHelp() {
100         cat.debug("-> getHelp");
101         return help;
102     }
103
104     /**
105      * Attribute name getter
106      *
107      * @return The name of the action
108      */

109     public String JavaDoc getName() {
110         cat.debug("-> getName");
111         return name;
112     }
113
114     /**
115      * Attribute number getter
116      *
117      * @return The number of the timer, in the object timers table
118      */

119     public String JavaDoc getNumber() {
120         cat.debug("-> getNumber");
121         return number;
122     }
123
124     /**
125      * Attribute params getter
126      *
127      * @return The parameters descriptions
128      */

129     public Vector getParams() {
130         cat.debug("-> getParams");
131         return params;
132     }
133 }
Popular Tags