1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package de.uka.ipd.sdq.probespec.impl; |
8 | |
9 | import de.uka.ipd.sdq.probespec.Calculator; |
10 | import de.uka.ipd.sdq.probespec.ProbeSpecRepository; |
11 | import de.uka.ipd.sdq.probespec.probespecPackage; |
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>Probe Spec Repository</b></em>'. |
30 | * <!-- end-user-doc --> |
31 | * <p> |
32 | * The following features are implemented: |
33 | * <ul> |
34 | * <li>{@link de.uka.ipd.sdq.probespec.impl.ProbeSpecRepositoryImpl#getCalculator <em>Calculator</em>}</li> |
35 | * </ul> |
36 | * </p> |
37 | * |
38 | * @generated |
39 | */ |
40 | public class ProbeSpecRepositoryImpl extends EObjectImpl implements ProbeSpecRepository { |
41 | /** |
42 | * The cached value of the '{@link #getCalculator() <em>Calculator</em>}' containment reference list. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @see #getCalculator() |
46 | * @generated |
47 | * @ordered |
48 | */ |
49 | protected EList<Calculator> calculator; |
50 | |
51 | /** |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | protected ProbeSpecRepositoryImpl() { |
57 | super(); |
58 | } |
59 | |
60 | /** |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @generated |
64 | */ |
65 | @Override |
66 | protected EClass eStaticClass() { |
67 | return probespecPackage.Literals.PROBE_SPEC_REPOSITORY; |
68 | } |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | public EList<Calculator> getCalculator() { |
76 | if (calculator == null) { |
77 | calculator = new EObjectContainmentEList<Calculator>(Calculator.class, this, probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR); |
78 | } |
79 | return calculator; |
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 probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR: |
91 | return ((InternalEList<?>)getCalculator()).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 probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR: |
105 | return getCalculator(); |
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 probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR: |
120 | getCalculator().clear(); |
121 | getCalculator().addAll((Collection<? extends Calculator>)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 probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR: |
136 | getCalculator().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 probespecPackage.PROBE_SPEC_REPOSITORY__CALCULATOR: |
151 | return calculator != null && !calculator.isEmpty(); |
152 | } |
153 | return super.eIsSet(featureID); |
154 | } |
155 | |
156 | } //ProbeSpecRepositoryImpl |