Regenerates EMF Compare static test profile.
[EMFCompare2.git] / plugins / org.eclipse.emf.compare.uml2.tests / profile / org / eclipse / emf / compare / uml2 / profile / test / uml2comparetestprofile / impl / AClicheImpl.java
blob203d8dee698aa6b29cc422ba3f44fe89f287f6fe
1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl;
13 import java.util.Collection;
15 import org.eclipse.emf.common.notify.Notification;
16 import org.eclipse.emf.common.util.EList;
17 import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.ACliche;
18 import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage;
19 import org.eclipse.emf.ecore.EClass;
20 import org.eclipse.emf.ecore.InternalEObject;
21 import org.eclipse.emf.ecore.impl.ENotificationImpl;
22 import org.eclipse.emf.ecore.impl.EObjectImpl;
23 import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
24 import org.eclipse.emf.ecore.util.EObjectResolvingEList;
26 /**
27 * <!-- begin-user-doc --> An implementation of the model object '<em><b>ACliche</b></em>'. <!-- end-user-doc
28 * -->
29 * <p>
30 * The following features are implemented:
31 * <ul>
32 * <li>
33 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getSingleValuedAttribute
34 * <em>Single Valued Attribute</em>}</li>
35 * <li>
36 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getManyValuedAttribute
37 * <em>Many Valued Attribute</em>}</li>
38 * <li>
39 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getSingleValuedReference
40 * <em>Single Valued Reference</em>}</li>
41 * <li>
42 * {@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getManyValuedReference
43 * <em>Many Valued Reference</em>}</li>
44 * <li>{@link org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.impl.AClicheImpl#getBase_Class
45 * <em>Base Class</em>}</li>
46 * </ul>
47 * </p>
49 * @generated
51 public class AClicheImpl extends EObjectImpl implements ACliche {
52 /**
53 * The default value of the '{@link #getSingleValuedAttribute() <em>Single Valued Attribute</em>}'
54 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
56 * @see #getSingleValuedAttribute()
57 * @generated
58 * @ordered
60 protected static final String SINGLE_VALUED_ATTRIBUTE_EDEFAULT = null;
62 /**
63 * The cached value of the '{@link #getSingleValuedAttribute() <em>Single Valued Attribute</em>}'
64 * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
66 * @see #getSingleValuedAttribute()
67 * @generated
68 * @ordered
70 protected String singleValuedAttribute = SINGLE_VALUED_ATTRIBUTE_EDEFAULT;
72 /**
73 * The cached value of the '{@link #getManyValuedAttribute() <em>Many Valued Attribute</em>}' attribute
74 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
76 * @see #getManyValuedAttribute()
77 * @generated
78 * @ordered
80 protected EList<String> manyValuedAttribute;
82 /**
83 * The cached value of the '{@link #getSingleValuedReference() <em>Single Valued Reference</em>}'
84 * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
86 * @see #getSingleValuedReference()
87 * @generated
88 * @ordered
90 protected org.eclipse.uml2.uml.Class singleValuedReference;
92 /**
93 * The cached value of the '{@link #getManyValuedReference() <em>Many Valued Reference</em>}' reference
94 * list. <!-- begin-user-doc --> <!-- end-user-doc -->
96 * @see #getManyValuedReference()
97 * @generated
98 * @ordered
100 protected EList<org.eclipse.uml2.uml.Class> manyValuedReference;
103 * The cached value of the '{@link #getBase_Class() <em>Base Class</em>}' reference. <!-- begin-user-doc
104 * --> <!-- end-user-doc -->
106 * @see #getBase_Class()
107 * @generated
108 * @ordered
110 protected org.eclipse.uml2.uml.Class base_Class;
113 * <!-- begin-user-doc --> <!-- end-user-doc -->
115 * @generated
117 protected AClicheImpl() {
118 super();
122 * <!-- begin-user-doc --> <!-- end-user-doc -->
124 * @generated
126 @Override
127 protected EClass eStaticClass() {
128 return UML2CompareTestProfilePackage.Literals.ACLICHE;
132 * <!-- begin-user-doc --> <!-- end-user-doc -->
134 * @generated
136 public String getSingleValuedAttribute() {
137 return singleValuedAttribute;
141 * <!-- begin-user-doc --> <!-- end-user-doc -->
143 * @generated
145 public void setSingleValuedAttribute(String newSingleValuedAttribute) {
146 String oldSingleValuedAttribute = singleValuedAttribute;
147 singleValuedAttribute = newSingleValuedAttribute;
148 if (eNotificationRequired())
149 eNotify(new ENotificationImpl(this, Notification.SET,
150 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE, oldSingleValuedAttribute,
151 singleValuedAttribute));
155 * <!-- begin-user-doc --> <!-- end-user-doc -->
157 * @generated
159 public EList<String> getManyValuedAttribute() {
160 if (manyValuedAttribute == null) {
161 manyValuedAttribute = new EDataTypeUniqueEList<String>(String.class, this,
162 UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE);
164 return manyValuedAttribute;
168 * <!-- begin-user-doc --> <!-- end-user-doc -->
170 * @generated
172 public org.eclipse.uml2.uml.Class getSingleValuedReference() {
173 if (singleValuedReference != null && singleValuedReference.eIsProxy()) {
174 InternalEObject oldSingleValuedReference = (InternalEObject)singleValuedReference;
175 singleValuedReference = (org.eclipse.uml2.uml.Class)eResolveProxy(oldSingleValuedReference);
176 if (singleValuedReference != oldSingleValuedReference) {
177 if (eNotificationRequired())
178 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
179 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE,
180 oldSingleValuedReference, singleValuedReference));
183 return singleValuedReference;
187 * <!-- begin-user-doc --> <!-- end-user-doc -->
189 * @generated
191 public org.eclipse.uml2.uml.Class basicGetSingleValuedReference() {
192 return singleValuedReference;
196 * <!-- begin-user-doc --> <!-- end-user-doc -->
198 * @generated
200 public void setSingleValuedReference(org.eclipse.uml2.uml.Class newSingleValuedReference) {
201 org.eclipse.uml2.uml.Class oldSingleValuedReference = singleValuedReference;
202 singleValuedReference = newSingleValuedReference;
203 if (eNotificationRequired())
204 eNotify(new ENotificationImpl(this, Notification.SET,
205 UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE, oldSingleValuedReference,
206 singleValuedReference));
210 * <!-- begin-user-doc --> <!-- end-user-doc -->
212 * @generated
214 public EList<org.eclipse.uml2.uml.Class> getManyValuedReference() {
215 if (manyValuedReference == null) {
216 manyValuedReference = new EObjectResolvingEList<org.eclipse.uml2.uml.Class>(
217 org.eclipse.uml2.uml.Class.class, this,
218 UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE);
220 return manyValuedReference;
224 * <!-- begin-user-doc --> <!-- end-user-doc -->
226 * @generated
228 public org.eclipse.uml2.uml.Class getManyValuedReference(String name) {
229 return getManyValuedReference(name, false, null);
233 * <!-- begin-user-doc --> <!-- end-user-doc -->
235 * @generated
237 public org.eclipse.uml2.uml.Class getManyValuedReference(String name, boolean ignoreCase, EClass eClass) {
238 manyValuedReferenceLoop: for (org.eclipse.uml2.uml.Class manyValuedReference : getManyValuedReference()) {
239 if (eClass != null && !eClass.isInstance(manyValuedReference))
240 continue manyValuedReferenceLoop;
241 if (name != null
242 && !(ignoreCase ? name.equalsIgnoreCase(manyValuedReference.getName()) : name
243 .equals(manyValuedReference.getName())))
244 continue manyValuedReferenceLoop;
245 return manyValuedReference;
247 return null;
251 * <!-- begin-user-doc --> <!-- end-user-doc -->
253 * @generated
255 public org.eclipse.uml2.uml.Class getBase_Class() {
256 if (base_Class != null && base_Class.eIsProxy()) {
257 InternalEObject oldBase_Class = (InternalEObject)base_Class;
258 base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class);
259 if (base_Class != oldBase_Class) {
260 if (eNotificationRequired())
261 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
262 UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS, oldBase_Class, base_Class));
265 return base_Class;
269 * <!-- begin-user-doc --> <!-- end-user-doc -->
271 * @generated
273 public org.eclipse.uml2.uml.Class basicGetBase_Class() {
274 return base_Class;
278 * <!-- begin-user-doc --> <!-- end-user-doc -->
280 * @generated
282 public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) {
283 org.eclipse.uml2.uml.Class oldBase_Class = base_Class;
284 base_Class = newBase_Class;
285 if (eNotificationRequired())
286 eNotify(new ENotificationImpl(this, Notification.SET,
287 UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS, oldBase_Class, base_Class));
291 * <!-- begin-user-doc --> <!-- end-user-doc -->
293 * @generated
295 @Override
296 public Object eGet(int featureID, boolean resolve, boolean coreType) {
297 switch (featureID) {
298 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
299 return getSingleValuedAttribute();
300 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
301 return getManyValuedAttribute();
302 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
303 if (resolve)
304 return getSingleValuedReference();
305 return basicGetSingleValuedReference();
306 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
307 return getManyValuedReference();
308 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
309 if (resolve)
310 return getBase_Class();
311 return basicGetBase_Class();
313 return super.eGet(featureID, resolve, coreType);
317 * <!-- begin-user-doc --> <!-- end-user-doc -->
319 * @generated
321 @SuppressWarnings("unchecked")
322 @Override
323 public void eSet(int featureID, Object newValue) {
324 switch (featureID) {
325 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
326 setSingleValuedAttribute((String)newValue);
327 return;
328 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
329 getManyValuedAttribute().clear();
330 getManyValuedAttribute().addAll((Collection<? extends String>)newValue);
331 return;
332 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
333 setSingleValuedReference((org.eclipse.uml2.uml.Class)newValue);
334 return;
335 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
336 getManyValuedReference().clear();
337 getManyValuedReference().addAll((Collection<? extends org.eclipse.uml2.uml.Class>)newValue);
338 return;
339 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
340 setBase_Class((org.eclipse.uml2.uml.Class)newValue);
341 return;
343 super.eSet(featureID, newValue);
347 * <!-- begin-user-doc --> <!-- end-user-doc -->
349 * @generated
351 @Override
352 public void eUnset(int featureID) {
353 switch (featureID) {
354 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
355 setSingleValuedAttribute(SINGLE_VALUED_ATTRIBUTE_EDEFAULT);
356 return;
357 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
358 getManyValuedAttribute().clear();
359 return;
360 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
361 setSingleValuedReference((org.eclipse.uml2.uml.Class)null);
362 return;
363 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
364 getManyValuedReference().clear();
365 return;
366 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
367 setBase_Class((org.eclipse.uml2.uml.Class)null);
368 return;
370 super.eUnset(featureID);
374 * <!-- begin-user-doc --> <!-- end-user-doc -->
376 * @generated
378 @Override
379 public boolean eIsSet(int featureID) {
380 switch (featureID) {
381 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_ATTRIBUTE:
382 return SINGLE_VALUED_ATTRIBUTE_EDEFAULT == null ? singleValuedAttribute != null
383 : !SINGLE_VALUED_ATTRIBUTE_EDEFAULT.equals(singleValuedAttribute);
384 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_ATTRIBUTE:
385 return manyValuedAttribute != null && !manyValuedAttribute.isEmpty();
386 case UML2CompareTestProfilePackage.ACLICHE__SINGLE_VALUED_REFERENCE:
387 return singleValuedReference != null;
388 case UML2CompareTestProfilePackage.ACLICHE__MANY_VALUED_REFERENCE:
389 return manyValuedReference != null && !manyValuedReference.isEmpty();
390 case UML2CompareTestProfilePackage.ACLICHE__BASE_CLASS:
391 return base_Class != null;
393 return super.eIsSet(featureID);
397 * <!-- begin-user-doc --> <!-- end-user-doc -->
399 * @generated
401 @Override
402 public String toString() {
403 if (eIsProxy())
404 return super.toString();
406 StringBuffer result = new StringBuffer(super.toString());
407 result.append(" (singleValuedAttribute: "); //$NON-NLS-1$
408 result.append(singleValuedAttribute);
409 result.append(", manyValuedAttribute: "); //$NON-NLS-1$
410 result.append(manyValuedAttribute);
411 result.append(')');
412 return result.toString();
415 } // AClicheImpl