1 | /** |
---|
2 | * <copyright> |
---|
3 | * </copyright> |
---|
4 | * |
---|
5 | */ |
---|
6 | package org.modelica.xtext.modelicaBase.impl; |
---|
7 | |
---|
8 | import org.eclipse.emf.common.notify.Notification; |
---|
9 | import org.eclipse.emf.common.notify.NotificationChain; |
---|
10 | |
---|
11 | import org.eclipse.emf.ecore.EClass; |
---|
12 | import org.eclipse.emf.ecore.InternalEObject; |
---|
13 | |
---|
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
---|
15 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
---|
16 | |
---|
17 | import org.modelica.xtext.modelicaBase.Comment; |
---|
18 | import org.modelica.xtext.modelicaBase.ModelicaBasePackage; |
---|
19 | import org.modelica.xtext.modelicaBase.algorithm; |
---|
20 | |
---|
21 | /** |
---|
22 | * <!-- begin-user-doc --> |
---|
23 | * An implementation of the model object '<em><b>algorithm</b></em>'. |
---|
24 | * <!-- end-user-doc --> |
---|
25 | * <p> |
---|
26 | * The following features are implemented: |
---|
27 | * <ul> |
---|
28 | * <li>{@link org.modelica.xtext.modelicaBase.impl.algorithmImpl#getComment <em>Comment</em>}</li> |
---|
29 | * </ul> |
---|
30 | * </p> |
---|
31 | * |
---|
32 | * @generated |
---|
33 | */ |
---|
34 | public class algorithmImpl extends MinimalEObjectImpl.Container implements algorithm |
---|
35 | { |
---|
36 | /** |
---|
37 | * The cached value of the '{@link #getComment() <em>Comment</em>}' containment reference. |
---|
38 | * <!-- begin-user-doc --> |
---|
39 | * <!-- end-user-doc --> |
---|
40 | * @see #getComment() |
---|
41 | * @generated |
---|
42 | * @ordered |
---|
43 | */ |
---|
44 | protected Comment comment; |
---|
45 | |
---|
46 | /** |
---|
47 | * <!-- begin-user-doc --> |
---|
48 | * <!-- end-user-doc --> |
---|
49 | * @generated |
---|
50 | */ |
---|
51 | protected algorithmImpl() |
---|
52 | { |
---|
53 | super(); |
---|
54 | } |
---|
55 | |
---|
56 | /** |
---|
57 | * <!-- begin-user-doc --> |
---|
58 | * <!-- end-user-doc --> |
---|
59 | * @generated |
---|
60 | */ |
---|
61 | @Override |
---|
62 | protected EClass eStaticClass() |
---|
63 | { |
---|
64 | return ModelicaBasePackage.Literals.ALGORITHM; |
---|
65 | } |
---|
66 | |
---|
67 | /** |
---|
68 | * <!-- begin-user-doc --> |
---|
69 | * <!-- end-user-doc --> |
---|
70 | * @generated |
---|
71 | */ |
---|
72 | public Comment getComment() |
---|
73 | { |
---|
74 | return comment; |
---|
75 | } |
---|
76 | |
---|
77 | /** |
---|
78 | * <!-- begin-user-doc --> |
---|
79 | * <!-- end-user-doc --> |
---|
80 | * @generated |
---|
81 | */ |
---|
82 | public NotificationChain basicSetComment(Comment newComment, NotificationChain msgs) |
---|
83 | { |
---|
84 | Comment oldComment = comment; |
---|
85 | comment = newComment; |
---|
86 | if (eNotificationRequired()) |
---|
87 | { |
---|
88 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.ALGORITHM__COMMENT, oldComment, newComment); |
---|
89 | if (msgs == null) msgs = notification; else msgs.add(notification); |
---|
90 | } |
---|
91 | return msgs; |
---|
92 | } |
---|
93 | |
---|
94 | /** |
---|
95 | * <!-- begin-user-doc --> |
---|
96 | * <!-- end-user-doc --> |
---|
97 | * @generated |
---|
98 | */ |
---|
99 | public void setComment(Comment newComment) |
---|
100 | { |
---|
101 | if (newComment != comment) |
---|
102 | { |
---|
103 | NotificationChain msgs = null; |
---|
104 | if (comment != null) |
---|
105 | msgs = ((InternalEObject)comment).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.ALGORITHM__COMMENT, null, msgs); |
---|
106 | if (newComment != null) |
---|
107 | msgs = ((InternalEObject)newComment).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelicaBasePackage.ALGORITHM__COMMENT, null, msgs); |
---|
108 | msgs = basicSetComment(newComment, msgs); |
---|
109 | if (msgs != null) msgs.dispatch(); |
---|
110 | } |
---|
111 | else if (eNotificationRequired()) |
---|
112 | eNotify(new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.ALGORITHM__COMMENT, newComment, newComment)); |
---|
113 | } |
---|
114 | |
---|
115 | /** |
---|
116 | * <!-- begin-user-doc --> |
---|
117 | * <!-- end-user-doc --> |
---|
118 | * @generated |
---|
119 | */ |
---|
120 | @Override |
---|
121 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
---|
122 | { |
---|
123 | switch (featureID) |
---|
124 | { |
---|
125 | case ModelicaBasePackage.ALGORITHM__COMMENT: |
---|
126 | return basicSetComment(null, msgs); |
---|
127 | } |
---|
128 | return super.eInverseRemove(otherEnd, featureID, msgs); |
---|
129 | } |
---|
130 | |
---|
131 | /** |
---|
132 | * <!-- begin-user-doc --> |
---|
133 | * <!-- end-user-doc --> |
---|
134 | * @generated |
---|
135 | */ |
---|
136 | @Override |
---|
137 | public Object eGet(int featureID, boolean resolve, boolean coreType) |
---|
138 | { |
---|
139 | switch (featureID) |
---|
140 | { |
---|
141 | case ModelicaBasePackage.ALGORITHM__COMMENT: |
---|
142 | return getComment(); |
---|
143 | } |
---|
144 | return super.eGet(featureID, resolve, coreType); |
---|
145 | } |
---|
146 | |
---|
147 | /** |
---|
148 | * <!-- begin-user-doc --> |
---|
149 | * <!-- end-user-doc --> |
---|
150 | * @generated |
---|
151 | */ |
---|
152 | @Override |
---|
153 | public void eSet(int featureID, Object newValue) |
---|
154 | { |
---|
155 | switch (featureID) |
---|
156 | { |
---|
157 | case ModelicaBasePackage.ALGORITHM__COMMENT: |
---|
158 | setComment((Comment)newValue); |
---|
159 | return; |
---|
160 | } |
---|
161 | super.eSet(featureID, newValue); |
---|
162 | } |
---|
163 | |
---|
164 | /** |
---|
165 | * <!-- begin-user-doc --> |
---|
166 | * <!-- end-user-doc --> |
---|
167 | * @generated |
---|
168 | */ |
---|
169 | @Override |
---|
170 | public void eUnset(int featureID) |
---|
171 | { |
---|
172 | switch (featureID) |
---|
173 | { |
---|
174 | case ModelicaBasePackage.ALGORITHM__COMMENT: |
---|
175 | setComment((Comment)null); |
---|
176 | return; |
---|
177 | } |
---|
178 | super.eUnset(featureID); |
---|
179 | } |
---|
180 | |
---|
181 | /** |
---|
182 | * <!-- begin-user-doc --> |
---|
183 | * <!-- end-user-doc --> |
---|
184 | * @generated |
---|
185 | */ |
---|
186 | @Override |
---|
187 | public boolean eIsSet(int featureID) |
---|
188 | { |
---|
189 | switch (featureID) |
---|
190 | { |
---|
191 | case ModelicaBasePackage.ALGORITHM__COMMENT: |
---|
192 | return comment != null; |
---|
193 | } |
---|
194 | return super.eIsSet(featureID); |
---|
195 | } |
---|
196 | |
---|
197 | } //algorithmImpl |
---|