/plugins/net.jgsuess.uml14/src/net/jgsuess/uml14/behavioral_elements/common_behavior/impl/ReceptionImpl.java

https://gitlab.com/jgsuess/uml-1.4.2 · Java · 445 lines · 208 code · 37 blank · 200 comment · 40 complexity · 0c5178309a8ecf55ea30ab92306227b8 MD5 · raw file

  1. /**
  2. * <copyright>
  3. * </copyright>
  4. *
  5. * $Id: ReceptionImpl.java,v 1.1 2012/04/23 09:31:14 uqjsuss Exp $
  6. */
  7. package net.jgsuess.uml14.behavioral_elements.common_behavior.impl;
  8. import net.jgsuess.uml14.behavioral_elements.common_behavior.Common_behaviorPackage;
  9. import net.jgsuess.uml14.behavioral_elements.common_behavior.Reception;
  10. import net.jgsuess.uml14.behavioral_elements.common_behavior.Signal;
  11. import net.jgsuess.uml14.foundation.core.impl.BehavioralFeatureImpl;
  12. import org.eclipse.emf.common.notify.Notification;
  13. import org.eclipse.emf.common.notify.NotificationChain;
  14. import org.eclipse.emf.ecore.EClass;
  15. import org.eclipse.emf.ecore.InternalEObject;
  16. import org.eclipse.emf.ecore.impl.ENotificationImpl;
  17. /**
  18. * <!-- begin-user-doc -->
  19. * An implementation of the model object '<em><b>Reception</b></em>'.
  20. * <!-- end-user-doc -->
  21. * <p>
  22. * The following features are implemented:
  23. * <ul>
  24. * <li>{@link net.jgsuess.uml14.behavioral_elements.common_behavior.impl.ReceptionImpl#getSpecification <em>Specification</em>}</li>
  25. * <li>{@link net.jgsuess.uml14.behavioral_elements.common_behavior.impl.ReceptionImpl#isIsRoot <em>Is Root</em>}</li>
  26. * <li>{@link net.jgsuess.uml14.behavioral_elements.common_behavior.impl.ReceptionImpl#isIsLeaf <em>Is Leaf</em>}</li>
  27. * <li>{@link net.jgsuess.uml14.behavioral_elements.common_behavior.impl.ReceptionImpl#isIsAbstract <em>Is Abstract</em>}</li>
  28. * <li>{@link net.jgsuess.uml14.behavioral_elements.common_behavior.impl.ReceptionImpl#getSignal <em>Signal</em>}</li>
  29. * </ul>
  30. * </p>
  31. *
  32. * @generated
  33. */
  34. public class ReceptionImpl extends BehavioralFeatureImpl implements Reception {
  35. /**
  36. * The default value of the '{@link #getSpecification() <em>Specification</em>}' attribute.
  37. * <!-- begin-user-doc -->
  38. * <!-- end-user-doc -->
  39. * @see #getSpecification()
  40. * @generated
  41. * @ordered
  42. */
  43. protected static final String SPECIFICATION_EDEFAULT = null;
  44. /**
  45. * The cached value of the '{@link #getSpecification() <em>Specification</em>}' attribute.
  46. * <!-- begin-user-doc -->
  47. * <!-- end-user-doc -->
  48. * @see #getSpecification()
  49. * @generated
  50. * @ordered
  51. */
  52. protected String specification = SPECIFICATION_EDEFAULT;
  53. /**
  54. * The default value of the '{@link #isIsRoot() <em>Is Root</em>}' attribute.
  55. * <!-- begin-user-doc -->
  56. * <!-- end-user-doc -->
  57. * @see #isIsRoot()
  58. * @generated
  59. * @ordered
  60. */
  61. protected static final boolean IS_ROOT_EDEFAULT = false;
  62. /**
  63. * The cached value of the '{@link #isIsRoot() <em>Is Root</em>}' attribute.
  64. * <!-- begin-user-doc -->
  65. * <!-- end-user-doc -->
  66. * @see #isIsRoot()
  67. * @generated
  68. * @ordered
  69. */
  70. protected boolean isRoot = IS_ROOT_EDEFAULT;
  71. /**
  72. * The default value of the '{@link #isIsLeaf() <em>Is Leaf</em>}' attribute.
  73. * <!-- begin-user-doc -->
  74. * <!-- end-user-doc -->
  75. * @see #isIsLeaf()
  76. * @generated
  77. * @ordered
  78. */
  79. protected static final boolean IS_LEAF_EDEFAULT = false;
  80. /**
  81. * The cached value of the '{@link #isIsLeaf() <em>Is Leaf</em>}' attribute.
  82. * <!-- begin-user-doc -->
  83. * <!-- end-user-doc -->
  84. * @see #isIsLeaf()
  85. * @generated
  86. * @ordered
  87. */
  88. protected boolean isLeaf = IS_LEAF_EDEFAULT;
  89. /**
  90. * The default value of the '{@link #isIsAbstract() <em>Is Abstract</em>}' attribute.
  91. * <!-- begin-user-doc -->
  92. * <!-- end-user-doc -->
  93. * @see #isIsAbstract()
  94. * @generated
  95. * @ordered
  96. */
  97. protected static final boolean IS_ABSTRACT_EDEFAULT = false;
  98. /**
  99. * The cached value of the '{@link #isIsAbstract() <em>Is Abstract</em>}' attribute.
  100. * <!-- begin-user-doc -->
  101. * <!-- end-user-doc -->
  102. * @see #isIsAbstract()
  103. * @generated
  104. * @ordered
  105. */
  106. protected boolean isAbstract = IS_ABSTRACT_EDEFAULT;
  107. /**
  108. * The cached value of the '{@link #getSignal() <em>Signal</em>}' reference.
  109. * <!-- begin-user-doc -->
  110. * <!-- end-user-doc -->
  111. * @see #getSignal()
  112. * @generated
  113. * @ordered
  114. */
  115. protected Signal signal;
  116. /**
  117. * <!-- begin-user-doc -->
  118. * <!-- end-user-doc -->
  119. * @generated
  120. */
  121. protected ReceptionImpl() {
  122. super();
  123. }
  124. /**
  125. * <!-- begin-user-doc -->
  126. * <!-- end-user-doc -->
  127. * @generated
  128. */
  129. @Override
  130. protected EClass eStaticClass() {
  131. return Common_behaviorPackage.Literals.RECEPTION;
  132. }
  133. /**
  134. * <!-- begin-user-doc -->
  135. * <!-- end-user-doc -->
  136. * @generated
  137. */
  138. public String getSpecification() {
  139. return specification;
  140. }
  141. /**
  142. * <!-- begin-user-doc -->
  143. * <!-- end-user-doc -->
  144. * @generated
  145. */
  146. public void setSpecification(String newSpecification) {
  147. String oldSpecification = specification;
  148. specification = newSpecification;
  149. if (eNotificationRequired())
  150. eNotify(new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__SPECIFICATION, oldSpecification, specification));
  151. }
  152. /**
  153. * <!-- begin-user-doc -->
  154. * <!-- end-user-doc -->
  155. * @generated
  156. */
  157. public boolean isIsRoot() {
  158. return isRoot;
  159. }
  160. /**
  161. * <!-- begin-user-doc -->
  162. * <!-- end-user-doc -->
  163. * @generated
  164. */
  165. public void setIsRoot(boolean newIsRoot) {
  166. boolean oldIsRoot = isRoot;
  167. isRoot = newIsRoot;
  168. if (eNotificationRequired())
  169. eNotify(new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__IS_ROOT, oldIsRoot, isRoot));
  170. }
  171. /**
  172. * <!-- begin-user-doc -->
  173. * <!-- end-user-doc -->
  174. * @generated
  175. */
  176. public boolean isIsLeaf() {
  177. return isLeaf;
  178. }
  179. /**
  180. * <!-- begin-user-doc -->
  181. * <!-- end-user-doc -->
  182. * @generated
  183. */
  184. public void setIsLeaf(boolean newIsLeaf) {
  185. boolean oldIsLeaf = isLeaf;
  186. isLeaf = newIsLeaf;
  187. if (eNotificationRequired())
  188. eNotify(new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__IS_LEAF, oldIsLeaf, isLeaf));
  189. }
  190. /**
  191. * <!-- begin-user-doc -->
  192. * <!-- end-user-doc -->
  193. * @generated
  194. */
  195. public boolean isIsAbstract() {
  196. return isAbstract;
  197. }
  198. /**
  199. * <!-- begin-user-doc -->
  200. * <!-- end-user-doc -->
  201. * @generated
  202. */
  203. public void setIsAbstract(boolean newIsAbstract) {
  204. boolean oldIsAbstract = isAbstract;
  205. isAbstract = newIsAbstract;
  206. if (eNotificationRequired())
  207. eNotify(new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__IS_ABSTRACT, oldIsAbstract, isAbstract));
  208. }
  209. /**
  210. * <!-- begin-user-doc -->
  211. * <!-- end-user-doc -->
  212. * @generated
  213. */
  214. public Signal getSignal() {
  215. if (signal != null && signal.eIsProxy()) {
  216. InternalEObject oldSignal = (InternalEObject)signal;
  217. signal = (Signal)eResolveProxy(oldSignal);
  218. if (signal != oldSignal) {
  219. if (eNotificationRequired())
  220. eNotify(new ENotificationImpl(this, Notification.RESOLVE, Common_behaviorPackage.RECEPTION__SIGNAL, oldSignal, signal));
  221. }
  222. }
  223. return signal;
  224. }
  225. /**
  226. * <!-- begin-user-doc -->
  227. * <!-- end-user-doc -->
  228. * @generated
  229. */
  230. public Signal basicGetSignal() {
  231. return signal;
  232. }
  233. /**
  234. * <!-- begin-user-doc -->
  235. * <!-- end-user-doc -->
  236. * @generated
  237. */
  238. public NotificationChain basicSetSignal(Signal newSignal, NotificationChain msgs) {
  239. Signal oldSignal = signal;
  240. signal = newSignal;
  241. if (eNotificationRequired()) {
  242. ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__SIGNAL, oldSignal, newSignal);
  243. if (msgs == null) msgs = notification; else msgs.add(notification);
  244. }
  245. return msgs;
  246. }
  247. /**
  248. * <!-- begin-user-doc -->
  249. * <!-- end-user-doc -->
  250. * @generated
  251. */
  252. public void setSignal(Signal newSignal) {
  253. if (newSignal != signal) {
  254. NotificationChain msgs = null;
  255. if (signal != null)
  256. msgs = ((InternalEObject)signal).eInverseRemove(this, Common_behaviorPackage.SIGNAL__RECEPTION, Signal.class, msgs);
  257. if (newSignal != null)
  258. msgs = ((InternalEObject)newSignal).eInverseAdd(this, Common_behaviorPackage.SIGNAL__RECEPTION, Signal.class, msgs);
  259. msgs = basicSetSignal(newSignal, msgs);
  260. if (msgs != null) msgs.dispatch();
  261. }
  262. else if (eNotificationRequired())
  263. eNotify(new ENotificationImpl(this, Notification.SET, Common_behaviorPackage.RECEPTION__SIGNAL, newSignal, newSignal));
  264. }
  265. /**
  266. * <!-- begin-user-doc -->
  267. * <!-- end-user-doc -->
  268. * @generated
  269. */
  270. @Override
  271. public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
  272. switch (featureID) {
  273. case Common_behaviorPackage.RECEPTION__SIGNAL:
  274. if (signal != null)
  275. msgs = ((InternalEObject)signal).eInverseRemove(this, Common_behaviorPackage.SIGNAL__RECEPTION, Signal.class, msgs);
  276. return basicSetSignal((Signal)otherEnd, msgs);
  277. }
  278. return super.eInverseAdd(otherEnd, featureID, msgs);
  279. }
  280. /**
  281. * <!-- begin-user-doc -->
  282. * <!-- end-user-doc -->
  283. * @generated
  284. */
  285. @Override
  286. public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
  287. switch (featureID) {
  288. case Common_behaviorPackage.RECEPTION__SIGNAL:
  289. return basicSetSignal(null, msgs);
  290. }
  291. return super.eInverseRemove(otherEnd, featureID, msgs);
  292. }
  293. /**
  294. * <!-- begin-user-doc -->
  295. * <!-- end-user-doc -->
  296. * @generated
  297. */
  298. @Override
  299. public Object eGet(int featureID, boolean resolve, boolean coreType) {
  300. switch (featureID) {
  301. case Common_behaviorPackage.RECEPTION__SPECIFICATION:
  302. return getSpecification();
  303. case Common_behaviorPackage.RECEPTION__IS_ROOT:
  304. return isIsRoot();
  305. case Common_behaviorPackage.RECEPTION__IS_LEAF:
  306. return isIsLeaf();
  307. case Common_behaviorPackage.RECEPTION__IS_ABSTRACT:
  308. return isIsAbstract();
  309. case Common_behaviorPackage.RECEPTION__SIGNAL:
  310. if (resolve) return getSignal();
  311. return basicGetSignal();
  312. }
  313. return super.eGet(featureID, resolve, coreType);
  314. }
  315. /**
  316. * <!-- begin-user-doc -->
  317. * <!-- end-user-doc -->
  318. * @generated
  319. */
  320. @Override
  321. public void eSet(int featureID, Object newValue) {
  322. switch (featureID) {
  323. case Common_behaviorPackage.RECEPTION__SPECIFICATION:
  324. setSpecification((String)newValue);
  325. return;
  326. case Common_behaviorPackage.RECEPTION__IS_ROOT:
  327. setIsRoot((Boolean)newValue);
  328. return;
  329. case Common_behaviorPackage.RECEPTION__IS_LEAF:
  330. setIsLeaf((Boolean)newValue);
  331. return;
  332. case Common_behaviorPackage.RECEPTION__IS_ABSTRACT:
  333. setIsAbstract((Boolean)newValue);
  334. return;
  335. case Common_behaviorPackage.RECEPTION__SIGNAL:
  336. setSignal((Signal)newValue);
  337. return;
  338. }
  339. super.eSet(featureID, newValue);
  340. }
  341. /**
  342. * <!-- begin-user-doc -->
  343. * <!-- end-user-doc -->
  344. * @generated
  345. */
  346. @Override
  347. public void eUnset(int featureID) {
  348. switch (featureID) {
  349. case Common_behaviorPackage.RECEPTION__SPECIFICATION:
  350. setSpecification(SPECIFICATION_EDEFAULT);
  351. return;
  352. case Common_behaviorPackage.RECEPTION__IS_ROOT:
  353. setIsRoot(IS_ROOT_EDEFAULT);
  354. return;
  355. case Common_behaviorPackage.RECEPTION__IS_LEAF:
  356. setIsLeaf(IS_LEAF_EDEFAULT);
  357. return;
  358. case Common_behaviorPackage.RECEPTION__IS_ABSTRACT:
  359. setIsAbstract(IS_ABSTRACT_EDEFAULT);
  360. return;
  361. case Common_behaviorPackage.RECEPTION__SIGNAL:
  362. setSignal((Signal)null);
  363. return;
  364. }
  365. super.eUnset(featureID);
  366. }
  367. /**
  368. * <!-- begin-user-doc -->
  369. * <!-- end-user-doc -->
  370. * @generated
  371. */
  372. @Override
  373. public boolean eIsSet(int featureID) {
  374. switch (featureID) {
  375. case Common_behaviorPackage.RECEPTION__SPECIFICATION:
  376. return SPECIFICATION_EDEFAULT == null ? specification != null : !SPECIFICATION_EDEFAULT.equals(specification);
  377. case Common_behaviorPackage.RECEPTION__IS_ROOT:
  378. return isRoot != IS_ROOT_EDEFAULT;
  379. case Common_behaviorPackage.RECEPTION__IS_LEAF:
  380. return isLeaf != IS_LEAF_EDEFAULT;
  381. case Common_behaviorPackage.RECEPTION__IS_ABSTRACT:
  382. return isAbstract != IS_ABSTRACT_EDEFAULT;
  383. case Common_behaviorPackage.RECEPTION__SIGNAL:
  384. return signal != null;
  385. }
  386. return super.eIsSet(featureID);
  387. }
  388. /**
  389. * <!-- begin-user-doc -->
  390. * <!-- end-user-doc -->
  391. * @generated
  392. */
  393. @Override
  394. public String toString() {
  395. if (eIsProxy()) return super.toString();
  396. StringBuffer result = new StringBuffer(super.toString());
  397. result.append(" (specification: ");
  398. result.append(specification);
  399. result.append(", isRoot: ");
  400. result.append(isRoot);
  401. result.append(", isLeaf: ");
  402. result.append(isLeaf);
  403. result.append(", isAbstract: ");
  404. result.append(isAbstract);
  405. result.append(')');
  406. return result.toString();
  407. }
  408. } //ReceptionImpl