1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.pcm.designdecision.GDoF.impl; |
8 | |
9 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.DegreeOfFreedom; |
10 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.DoFRepository; |
11 | import de.uka.ipd.sdq.pcm.designdecision.GDoF.GDoFPackage; |
12 | |
13 | import java.util.Collection; |
14 | |
15 | import org.eclipse.emf.common.notify.NotificationChain; |
16 | |
17 | import org.eclipse.emf.common.util.EList; |
18 | |
19 | import org.eclipse.emf.ecore.EClass; |
20 | import org.eclipse.emf.ecore.InternalEObject; |
21 | |
22 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
23 | |
24 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
25 | import org.eclipse.emf.ecore.util.InternalEList; |
26 | |
27 | /** |
28 | * <!-- begin-user-doc --> |
29 | * An implementation of the model object '<em><b>Do FRepository</b></em>'. |
30 | * <!-- end-user-doc --> |
31 | * <p> |
32 | * The following features are implemented: |
33 | * <ul> |
34 | * <li>{@link de.uka.ipd.sdq.pcm.designdecision.GDoF.impl.DoFRepositoryImpl#getDofs <em>Dofs</em>}</li> |
35 | * </ul> |
36 | * </p> |
37 | * |
38 | * @generated |
39 | */ |
40 | public class DoFRepositoryImpl extends EObjectImpl implements DoFRepository { |
41 | /** |
42 | * The cached value of the '{@link #getDofs() <em>Dofs</em>}' containment reference list. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @see #getDofs() |
46 | * @generated |
47 | * @ordered |
48 | */ |
49 | protected EList<DegreeOfFreedom> dofs; |
50 | |
51 | /** |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | protected DoFRepositoryImpl() { |
57 | super(); |
58 | } |
59 | |
60 | /** |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @generated |
64 | */ |
65 | @Override |
66 | protected EClass eStaticClass() { |
67 | return GDoFPackage.Literals.DO_FREPOSITORY; |
68 | } |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | public EList<DegreeOfFreedom> getDofs() { |
76 | if (dofs == null) { |
77 | dofs = new EObjectContainmentEList<DegreeOfFreedom>(DegreeOfFreedom.class, this, GDoFPackage.DO_FREPOSITORY__DOFS); |
78 | } |
79 | return dofs; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | @Override |
88 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
89 | switch (featureID) { |
90 | case GDoFPackage.DO_FREPOSITORY__DOFS: |
91 | return ((InternalEList<?>)getDofs()).basicRemove(otherEnd, msgs); |
92 | } |
93 | return super.eInverseRemove(otherEnd, featureID, msgs); |
94 | } |
95 | |
96 | /** |
97 | * <!-- begin-user-doc --> |
98 | * <!-- end-user-doc --> |
99 | * @generated |
100 | */ |
101 | @Override |
102 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
103 | switch (featureID) { |
104 | case GDoFPackage.DO_FREPOSITORY__DOFS: |
105 | return getDofs(); |
106 | } |
107 | return super.eGet(featureID, resolve, coreType); |
108 | } |
109 | |
110 | /** |
111 | * <!-- begin-user-doc --> |
112 | * <!-- end-user-doc --> |
113 | * @generated |
114 | */ |
115 | @SuppressWarnings("unchecked") |
116 | @Override |
117 | public void eSet(int featureID, Object newValue) { |
118 | switch (featureID) { |
119 | case GDoFPackage.DO_FREPOSITORY__DOFS: |
120 | getDofs().clear(); |
121 | getDofs().addAll((Collection<? extends DegreeOfFreedom>)newValue); |
122 | return; |
123 | } |
124 | super.eSet(featureID, newValue); |
125 | } |
126 | |
127 | /** |
128 | * <!-- begin-user-doc --> |
129 | * <!-- end-user-doc --> |
130 | * @generated |
131 | */ |
132 | @Override |
133 | public void eUnset(int featureID) { |
134 | switch (featureID) { |
135 | case GDoFPackage.DO_FREPOSITORY__DOFS: |
136 | getDofs().clear(); |
137 | return; |
138 | } |
139 | super.eUnset(featureID); |
140 | } |
141 | |
142 | /** |
143 | * <!-- begin-user-doc --> |
144 | * <!-- end-user-doc --> |
145 | * @generated |
146 | */ |
147 | @Override |
148 | public boolean eIsSet(int featureID) { |
149 | switch (featureID) { |
150 | case GDoFPackage.DO_FREPOSITORY__DOFS: |
151 | return dofs != null && !dofs.isEmpty(); |
152 | } |
153 | return super.eIsSet(featureID); |
154 | } |
155 | |
156 | } //DoFRepositoryImpl |