/edu.ustb.sei.rmg.config/src/edu/ustb/sei/rmg/config/util/ConfigSwitch.java

https://bitbucket.org/ustbmde/model-generation · Java · 377 lines · 159 code · 22 blank · 196 comment · 60 complexity · 9db10b25d3df3a89f1a78def0a01f03e MD5 · raw file

  1. /**
  2. */
  3. package edu.ustb.sei.rmg.config.util;
  4. import edu.ustb.sei.rmg.config.*;
  5. import org.eclipse.emf.ecore.EObject;
  6. import org.eclipse.emf.ecore.EPackage;
  7. import org.eclipse.emf.ecore.util.Switch;
  8. /**
  9. * <!-- begin-user-doc -->
  10. * The <b>Switch</b> for the model's inheritance hierarchy.
  11. * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
  12. * to invoke the <code>caseXXX</code> method for each class of the model,
  13. * starting with the actual class of the object
  14. * and proceeding up the inheritance hierarchy
  15. * until a non-null result is returned,
  16. * which is the result of the switch.
  17. * <!-- end-user-doc -->
  18. * @see edu.ustb.sei.rmg.config.ConfigPackage
  19. * @generated
  20. */
  21. public class ConfigSwitch<T> extends Switch<T> {
  22. /**
  23. * The cached model package
  24. * <!-- begin-user-doc -->
  25. * <!-- end-user-doc -->
  26. * @generated
  27. */
  28. protected static ConfigPackage modelPackage;
  29. /**
  30. * Creates an instance of the switch.
  31. * <!-- begin-user-doc -->
  32. * <!-- end-user-doc -->
  33. * @generated
  34. */
  35. public ConfigSwitch() {
  36. if (modelPackage == null) {
  37. modelPackage = ConfigPackage.eINSTANCE;
  38. }
  39. }
  40. /**
  41. * Checks whether this is a switch for the given package.
  42. * <!-- begin-user-doc -->
  43. * <!-- end-user-doc -->
  44. * @param ePackage the package in question.
  45. * @return whether this is a switch for the given package.
  46. * @generated
  47. */
  48. @Override
  49. protected boolean isSwitchFor(EPackage ePackage) {
  50. return ePackage == modelPackage;
  51. }
  52. /**
  53. * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
  54. * <!-- begin-user-doc -->
  55. * <!-- end-user-doc -->
  56. * @return the first non-null result returned by a <code>caseXXX</code> call.
  57. * @generated
  58. */
  59. @Override
  60. protected T doSwitch(int classifierID, EObject theEObject) {
  61. switch (classifierID) {
  62. case ConfigPackage.OPTION_MODEL: {
  63. OptionModel optionModel = (OptionModel)theEObject;
  64. T result = caseOptionModel(optionModel);
  65. if (result == null) result = defaultCase(theEObject);
  66. return result;
  67. }
  68. case ConfigPackage.CLASS_OPTION: {
  69. ClassOption classOption = (ClassOption)theEObject;
  70. T result = caseClassOption(classOption);
  71. if (result == null) result = caseScalableCondition(classOption);
  72. if (result == null) result = caseCondition(classOption);
  73. if (result == null) result = defaultCase(theEObject);
  74. return result;
  75. }
  76. case ConfigPackage.REFERENCE_OPTION: {
  77. ReferenceOption referenceOption = (ReferenceOption)theEObject;
  78. T result = caseReferenceOption(referenceOption);
  79. if (result == null) result = caseAbstractReferenceOption(referenceOption);
  80. if (result == null) result = caseScalableCondition(referenceOption);
  81. if (result == null) result = caseCondition(referenceOption);
  82. if (result == null) result = defaultCase(theEObject);
  83. return result;
  84. }
  85. case ConfigPackage.REFERENCE_GROUP_OPTION: {
  86. ReferenceGroupOption referenceGroupOption = (ReferenceGroupOption)theEObject;
  87. T result = caseReferenceGroupOption(referenceGroupOption);
  88. if (result == null) result = caseAbstractReferenceOption(referenceGroupOption);
  89. if (result == null) result = caseScalableCondition(referenceGroupOption);
  90. if (result == null) result = caseCondition(referenceGroupOption);
  91. if (result == null) result = defaultCase(theEObject);
  92. return result;
  93. }
  94. case ConfigPackage.ABSTRACT_REFERENCE_OPTION: {
  95. AbstractReferenceOption abstractReferenceOption = (AbstractReferenceOption)theEObject;
  96. T result = caseAbstractReferenceOption(abstractReferenceOption);
  97. if (result == null) result = caseScalableCondition(abstractReferenceOption);
  98. if (result == null) result = caseCondition(abstractReferenceOption);
  99. if (result == null) result = defaultCase(theEObject);
  100. return result;
  101. }
  102. case ConfigPackage.ATTRIBUTE_OPTION: {
  103. AttributeOption attributeOption = (AttributeOption)theEObject;
  104. T result = caseAttributeOption(attributeOption);
  105. if (result == null) result = caseCondition(attributeOption);
  106. if (result == null) result = defaultCase(theEObject);
  107. return result;
  108. }
  109. case ConfigPackage.GLOBAL_OPTION: {
  110. GlobalOption globalOption = (GlobalOption)theEObject;
  111. T result = caseGlobalOption(globalOption);
  112. if (result == null) result = caseCondition(globalOption);
  113. if (result == null) result = defaultCase(theEObject);
  114. return result;
  115. }
  116. case ConfigPackage.CONDITION: {
  117. Condition condition = (Condition)theEObject;
  118. T result = caseCondition(condition);
  119. if (result == null) result = defaultCase(theEObject);
  120. return result;
  121. }
  122. case ConfigPackage.SCALABLE_CONDITION: {
  123. ScalableCondition scalableCondition = (ScalableCondition)theEObject;
  124. T result = caseScalableCondition(scalableCondition);
  125. if (result == null) result = caseCondition(scalableCondition);
  126. if (result == null) result = defaultCase(theEObject);
  127. return result;
  128. }
  129. case ConfigPackage.FILTER: {
  130. Filter filter = (Filter)theEObject;
  131. T result = caseFilter(filter);
  132. if (result == null) result = defaultCase(theEObject);
  133. return result;
  134. }
  135. case ConfigPackage.BASIC_FILTER: {
  136. BasicFilter basicFilter = (BasicFilter)theEObject;
  137. T result = caseBasicFilter(basicFilter);
  138. if (result == null) result = caseFilter(basicFilter);
  139. if (result == null) result = defaultCase(theEObject);
  140. return result;
  141. }
  142. case ConfigPackage.COMBINATIONAL_FILTER: {
  143. CombinationalFilter combinationalFilter = (CombinationalFilter)theEObject;
  144. T result = caseCombinationalFilter(combinationalFilter);
  145. if (result == null) result = caseFilter(combinationalFilter);
  146. if (result == null) result = defaultCase(theEObject);
  147. return result;
  148. }
  149. case ConfigPackage.REFERENCE_FILTER_OPTION: {
  150. ReferenceFilterOption referenceFilterOption = (ReferenceFilterOption)theEObject;
  151. T result = caseReferenceFilterOption(referenceFilterOption);
  152. if (result == null) result = defaultCase(theEObject);
  153. return result;
  154. }
  155. default: return defaultCase(theEObject);
  156. }
  157. }
  158. /**
  159. * Returns the result of interpreting the object as an instance of '<em>Option Model</em>'.
  160. * <!-- begin-user-doc -->
  161. * This implementation returns null;
  162. * returning a non-null result will terminate the switch.
  163. * <!-- end-user-doc -->
  164. * @param object the target of the switch.
  165. * @return the result of interpreting the object as an instance of '<em>Option Model</em>'.
  166. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  167. * @generated
  168. */
  169. public T caseOptionModel(OptionModel object) {
  170. return null;
  171. }
  172. /**
  173. * Returns the result of interpreting the object as an instance of '<em>Class Option</em>'.
  174. * <!-- begin-user-doc -->
  175. * This implementation returns null;
  176. * returning a non-null result will terminate the switch.
  177. * <!-- end-user-doc -->
  178. * @param object the target of the switch.
  179. * @return the result of interpreting the object as an instance of '<em>Class Option</em>'.
  180. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  181. * @generated
  182. */
  183. public T caseClassOption(ClassOption object) {
  184. return null;
  185. }
  186. /**
  187. * Returns the result of interpreting the object as an instance of '<em>Reference Option</em>'.
  188. * <!-- begin-user-doc -->
  189. * This implementation returns null;
  190. * returning a non-null result will terminate the switch.
  191. * <!-- end-user-doc -->
  192. * @param object the target of the switch.
  193. * @return the result of interpreting the object as an instance of '<em>Reference Option</em>'.
  194. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  195. * @generated
  196. */
  197. public T caseReferenceOption(ReferenceOption object) {
  198. return null;
  199. }
  200. /**
  201. * Returns the result of interpreting the object as an instance of '<em>Reference Group Option</em>'.
  202. * <!-- begin-user-doc -->
  203. * This implementation returns null;
  204. * returning a non-null result will terminate the switch.
  205. * <!-- end-user-doc -->
  206. * @param object the target of the switch.
  207. * @return the result of interpreting the object as an instance of '<em>Reference Group Option</em>'.
  208. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  209. * @generated
  210. */
  211. public T caseReferenceGroupOption(ReferenceGroupOption object) {
  212. return null;
  213. }
  214. /**
  215. * Returns the result of interpreting the object as an instance of '<em>Abstract Reference Option</em>'.
  216. * <!-- begin-user-doc -->
  217. * This implementation returns null;
  218. * returning a non-null result will terminate the switch.
  219. * <!-- end-user-doc -->
  220. * @param object the target of the switch.
  221. * @return the result of interpreting the object as an instance of '<em>Abstract Reference Option</em>'.
  222. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  223. * @generated
  224. */
  225. public T caseAbstractReferenceOption(AbstractReferenceOption object) {
  226. return null;
  227. }
  228. /**
  229. * Returns the result of interpreting the object as an instance of '<em>Attribute Option</em>'.
  230. * <!-- begin-user-doc -->
  231. * This implementation returns null;
  232. * returning a non-null result will terminate the switch.
  233. * <!-- end-user-doc -->
  234. * @param object the target of the switch.
  235. * @return the result of interpreting the object as an instance of '<em>Attribute Option</em>'.
  236. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  237. * @generated
  238. */
  239. public T caseAttributeOption(AttributeOption object) {
  240. return null;
  241. }
  242. /**
  243. * Returns the result of interpreting the object as an instance of '<em>Global Option</em>'.
  244. * <!-- begin-user-doc -->
  245. * This implementation returns null;
  246. * returning a non-null result will terminate the switch.
  247. * <!-- end-user-doc -->
  248. * @param object the target of the switch.
  249. * @return the result of interpreting the object as an instance of '<em>Global Option</em>'.
  250. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  251. * @generated
  252. */
  253. public T caseGlobalOption(GlobalOption object) {
  254. return null;
  255. }
  256. /**
  257. * Returns the result of interpreting the object as an instance of '<em>Condition</em>'.
  258. * <!-- begin-user-doc -->
  259. * This implementation returns null;
  260. * returning a non-null result will terminate the switch.
  261. * <!-- end-user-doc -->
  262. * @param object the target of the switch.
  263. * @return the result of interpreting the object as an instance of '<em>Condition</em>'.
  264. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  265. * @generated
  266. */
  267. public T caseCondition(Condition object) {
  268. return null;
  269. }
  270. /**
  271. * Returns the result of interpreting the object as an instance of '<em>Scalable Condition</em>'.
  272. * <!-- begin-user-doc -->
  273. * This implementation returns null;
  274. * returning a non-null result will terminate the switch.
  275. * <!-- end-user-doc -->
  276. * @param object the target of the switch.
  277. * @return the result of interpreting the object as an instance of '<em>Scalable Condition</em>'.
  278. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  279. * @generated
  280. */
  281. public T caseScalableCondition(ScalableCondition object) {
  282. return null;
  283. }
  284. /**
  285. * Returns the result of interpreting the object as an instance of '<em>Filter</em>'.
  286. * <!-- begin-user-doc -->
  287. * This implementation returns null;
  288. * returning a non-null result will terminate the switch.
  289. * <!-- end-user-doc -->
  290. * @param object the target of the switch.
  291. * @return the result of interpreting the object as an instance of '<em>Filter</em>'.
  292. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  293. * @generated
  294. */
  295. public T caseFilter(Filter object) {
  296. return null;
  297. }
  298. /**
  299. * Returns the result of interpreting the object as an instance of '<em>Basic Filter</em>'.
  300. * <!-- begin-user-doc -->
  301. * This implementation returns null;
  302. * returning a non-null result will terminate the switch.
  303. * <!-- end-user-doc -->
  304. * @param object the target of the switch.
  305. * @return the result of interpreting the object as an instance of '<em>Basic Filter</em>'.
  306. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  307. * @generated
  308. */
  309. public T caseBasicFilter(BasicFilter object) {
  310. return null;
  311. }
  312. /**
  313. * Returns the result of interpreting the object as an instance of '<em>Combinational Filter</em>'.
  314. * <!-- begin-user-doc -->
  315. * This implementation returns null;
  316. * returning a non-null result will terminate the switch.
  317. * <!-- end-user-doc -->
  318. * @param object the target of the switch.
  319. * @return the result of interpreting the object as an instance of '<em>Combinational Filter</em>'.
  320. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  321. * @generated
  322. */
  323. public T caseCombinationalFilter(CombinationalFilter object) {
  324. return null;
  325. }
  326. /**
  327. * Returns the result of interpreting the object as an instance of '<em>Reference Filter Option</em>'.
  328. * <!-- begin-user-doc -->
  329. * This implementation returns null;
  330. * returning a non-null result will terminate the switch.
  331. * <!-- end-user-doc -->
  332. * @param object the target of the switch.
  333. * @return the result of interpreting the object as an instance of '<em>Reference Filter Option</em>'.
  334. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
  335. * @generated
  336. */
  337. public T caseReferenceFilterOption(ReferenceFilterOption object) {
  338. return null;
  339. }
  340. /**
  341. * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
  342. * <!-- begin-user-doc -->
  343. * This implementation returns null;
  344. * returning a non-null result will terminate the switch, but this is the last case anyway.
  345. * <!-- end-user-doc -->
  346. * @param object the target of the switch.
  347. * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
  348. * @see #doSwitch(org.eclipse.emf.ecore.EObject)
  349. * @generated
  350. */
  351. @Override
  352. public T defaultCase(EObject object) {
  353. return null;
  354. }
  355. } //ConfigSwitch