1 23 package org.objectweb.clif.scenario.util.isac.util.tree; 24 25 import org.apache.log4j.Category; 26 27 33 public class Node { 34 static Category cat = Category.getInstance(Node.class.getName()) ; 35 38 public static final String UNKNOW = "unknow"; 39 42 public static final String SCENARIO = "scenario"; 43 46 public static final String IF = "if"; 47 50 public static final String THEN = "then"; 51 54 public static final String ELSE = "else"; 55 58 public static final String WHILE = "while"; 59 62 public static final String PREEMPTIVE = "preemptive"; 63 66 public static final String NCHOICE = "nchoice"; 67 70 public static final String CHOICE = "choice" ; 71 74 public static final String BEHAVIORS = "behaviors"; 75 78 public static final String BEHAVIOR = "behavior"; 79 82 public static final String PLUGINS = "plugins"; 83 86 public static final String TEST = "test"; 87 90 public static final String TIMER = "timer"; 91 94 public static final String SAMPLE = "sample"; 95 98 public static final String USE = "use"; 99 102 public static final String LOAD_PROFILE = "loadprofile"; 103 104 105 public static final String CONDITION = "condition" ; 106 public static final String PARAMS = "params" ; 107 public static final String PARAM = "param" ; 108 111 public static final String GROUP = "group"; 112 115 public static final String RAMP = "ramp"; 116 119 public static final String POINTS = "points"; 120 123 public static final String POINT = "point"; 124 125 126 131 public static boolean isPluginNode(String type) { 132 cat.debug("-> isPluginNode") ; 133 if (type == null) 134 return false ; 135 if (type.equals(Node.SAMPLE)) 136 return true; 137 if (type.equals(Node.TIMER)) 138 return true; 139 if (type.equals(Node.TEST)) 140 return true; 141 if (type.equals(Node.USE)) 142 return true; 143 return false; 144 } 145 146 151 public static boolean isControllerNode(String type) { 152 cat.debug("-> isControllerNode") ; 153 if (type == null) 154 return false; 155 if (type.equals(Node.IF)) 156 return true ; 157 if (type.equals(Node.WHILE)) 158 return true ; 159 if (type.equals(Node.PREEMPTIVE)) 160 return true ; 161 return false ; 162 } 163 164 169 public static boolean isBehaviorsNode(String type) { 170 cat.debug("-> isBehaviorsNode") ; 171 if (type == null) 172 return false ; 173 if (type.equals(Node.SAMPLE)) 174 return true; 175 if (type.equals(Node.TIMER)) 176 return true; 177 if (type.equals(Node.TEST)) 178 return true; 179 if (type.equals(Node.USE)) 180 return true; 181 if (type.equals(Node.IF)) 182 return true ; 183 if (type.equals(Node.THEN)) 184 return true ; 185 if (type.equals(Node.ELSE)) 186 return true ; 187 if (type.equals(Node.WHILE)) 188 return true ; 189 if (type.equals(Node.PREEMPTIVE)) 190 return true ; 191 if (type.equals(Node.NCHOICE)) 192 return true ; 193 if (type.equals(Node.CHOICE)) 194 return true ; 195 if (type.equals(Node.BEHAVIORS)) 196 return true ; 197 if (type.equals(Node.BEHAVIOR)) 198 return true ; 199 if (type.equals(Node.PLUGINS)) 200 return true ; 201 return false; 202 } 203 204 209 public static boolean isStructureNode(String type) { 210 cat.debug("-> isStructureNode") ; 211 if (type == null) 212 return false ; 213 if (type.equals(BEHAVIOR)) 214 return true ; 215 if (type.equals(PLUGINS)) 216 return true ; 217 if (type.equals(BEHAVIORS)) 218 return true ; 219 return false ; 220 } 221 } 222 | Popular Tags |