KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > util > tree > nodes > ControlerNode


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.util.tree.nodes;
24
25 import java.util.Vector JavaDoc;
26
27 import org.objectweb.clif.scenario.util.isac.util.tree.Node;
28 import org.objectweb.clif.scenario.util.isac.util.tree.NodeDescription;
29
30 /**
31  * This class implements some method which will be used when we will create some
32  * controlers nodes
33  *
34  * @author JC Meillaud
35  * @author A Peyrard
36  */

37 public class ControlerNode {
38
39     /**
40      * Get the help for the type of controler node given in parameter
41      * @param type The type of the controler node
42      * @return The help lines
43      */

44     public static Vector JavaDoc getHelp(String JavaDoc type) {
45         if (type.equals(Node.IF))
46             return IfNode.getHelp() ;
47         if (type.equals(Node.WHILE))
48             return WhileNode.getHelp() ;
49         if (type.equals(Node.PREEMPTIVE))
50             return PreemptiveNode.getHelp() ;
51         return null ;
52     }
53     
54     /**
55      * This method create a node description for the controler node described in parameter
56      * @param plugin The plugin name of the test
57      * @param type The type of the node, which will be used a test
58      * @param name The name of the test used
59      * @return The node description for this controler node
60      */

61     public static NodeDescription createNodeDescription(String JavaDoc plugin, String JavaDoc type, String JavaDoc name) {
62         if (type.equals(Node.IF))
63             return IfNode.createNodeDescription(plugin, name) ;
64         if (type.equals(Node.WHILE))
65             return WhileNode.createNodeDescription(plugin, name) ;
66         if (type.equals(Node.PREEMPTIVE))
67             return PreemptiveNode.createNodeDescription(plugin, name) ;
68         return null ;
69     }
70 }
71
Popular Tags