[572074] Constraint gmf.runtime range for Sirius integration
[EMFCompare2.git] / plugins / org.eclipse.emf.compare / src-gen / org / eclipse / emf / compare / impl / ResourceLocationChangeImpl.java
blob37bd414452a4b5646cb0096e6185d5987d9496ac
1 /**
2 * Copyright (c) 2012 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
11 package org.eclipse.emf.compare.impl;
13 import org.eclipse.emf.common.notify.Notification;
14 import org.eclipse.emf.compare.ComparePackage;
15 import org.eclipse.emf.compare.ResourceLocationChange;
17 import org.eclipse.emf.ecore.EClass;
18 import org.eclipse.emf.ecore.impl.ENotificationImpl;
20 /**
21 * <!-- begin-user-doc -->
22 * An implementation of the model object '<em><b>Resource Location Change</b></em>'.
23 * <!-- end-user-doc -->
24 * <p>
25 * The following features are implemented:
26 * <ul>
27 * <li>{@link org.eclipse.emf.compare.impl.ResourceLocationChangeImpl#getBaseLocation <em>Base Location</em>}</li>
28 * <li>{@link org.eclipse.emf.compare.impl.ResourceLocationChangeImpl#getChangedLocation <em>Changed Location</em>}</li>
29 * </ul>
30 * </p>
32 * @generated
33 * @since 3.2
35 public class ResourceLocationChangeImpl extends DiffImpl implements ResourceLocationChange {
36 /**
37 * <!-- begin-user-doc -->
38 * <!-- end-user-doc -->
39 * @generated
41 @SuppressWarnings("hiding")
42 public static final String copyright = "Copyright (c) 2012 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; //$NON-NLS-1$
44 /**
45 * The default value of the '{@link #getBaseLocation() <em>Base Location</em>}' attribute.
46 * <!-- begin-user-doc -->
47 * <!-- end-user-doc -->
48 * @see #getBaseLocation()
49 * @generated
50 * @ordered
52 protected static final String BASE_LOCATION_EDEFAULT = null;
54 /**
55 * The cached value of the '{@link #getBaseLocation() <em>Base Location</em>}' attribute.
56 * <!-- begin-user-doc -->
57 * <!-- end-user-doc -->
58 * @see #getBaseLocation()
59 * @generated
60 * @ordered
62 protected String baseLocation = BASE_LOCATION_EDEFAULT;
64 /**
65 * The default value of the '{@link #getChangedLocation() <em>Changed Location</em>}' attribute.
66 * <!-- begin-user-doc -->
67 * <!-- end-user-doc -->
68 * @see #getChangedLocation()
69 * @generated
70 * @ordered
72 protected static final String CHANGED_LOCATION_EDEFAULT = null;
74 /**
75 * The cached value of the '{@link #getChangedLocation() <em>Changed Location</em>}' attribute.
76 * <!-- begin-user-doc -->
77 * <!-- end-user-doc -->
78 * @see #getChangedLocation()
79 * @generated
80 * @ordered
82 protected String changedLocation = CHANGED_LOCATION_EDEFAULT;
84 /**
85 * <!-- begin-user-doc -->
86 * <!-- end-user-doc -->
87 * @generated
89 protected ResourceLocationChangeImpl() {
90 super();
93 /**
94 * <!-- begin-user-doc -->
95 * <!-- end-user-doc -->
96 * @generated
98 @Override
99 protected EClass eStaticClass() {
100 return ComparePackage.Literals.RESOURCE_LOCATION_CHANGE;
104 * <!-- begin-user-doc -->
105 * <!-- end-user-doc -->
106 * @generated
108 public String getBaseLocation() {
109 return baseLocation;
113 * <!-- begin-user-doc -->
114 * <!-- end-user-doc -->
115 * @generated
117 public void setBaseLocation(String newBaseLocation) {
118 String oldBaseLocation = baseLocation;
119 baseLocation = newBaseLocation;
120 if (eNotificationRequired())
121 eNotify(new ENotificationImpl(this, Notification.SET,
122 ComparePackage.RESOURCE_LOCATION_CHANGE__BASE_LOCATION, oldBaseLocation, baseLocation));
126 * <!-- begin-user-doc -->
127 * <!-- end-user-doc -->
128 * @generated
130 public String getChangedLocation() {
131 return changedLocation;
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
137 * @generated
139 public void setChangedLocation(String newChangedLocation) {
140 String oldChangedLocation = changedLocation;
141 changedLocation = newChangedLocation;
142 if (eNotificationRequired())
143 eNotify(new ENotificationImpl(this, Notification.SET,
144 ComparePackage.RESOURCE_LOCATION_CHANGE__CHANGED_LOCATION, oldChangedLocation,
145 changedLocation));
149 * <!-- begin-user-doc -->
150 * <!-- end-user-doc -->
151 * @generated
153 @Override
154 public Object eGet(int featureID, boolean resolve, boolean coreType) {
155 switch (featureID) {
156 case ComparePackage.RESOURCE_LOCATION_CHANGE__BASE_LOCATION:
157 return getBaseLocation();
158 case ComparePackage.RESOURCE_LOCATION_CHANGE__CHANGED_LOCATION:
159 return getChangedLocation();
161 return super.eGet(featureID, resolve, coreType);
165 * <!-- begin-user-doc -->
166 * <!-- end-user-doc -->
167 * @generated
169 @Override
170 public void eSet(int featureID, Object newValue) {
171 switch (featureID) {
172 case ComparePackage.RESOURCE_LOCATION_CHANGE__BASE_LOCATION:
173 setBaseLocation((String)newValue);
174 return;
175 case ComparePackage.RESOURCE_LOCATION_CHANGE__CHANGED_LOCATION:
176 setChangedLocation((String)newValue);
177 return;
179 super.eSet(featureID, newValue);
183 * <!-- begin-user-doc -->
184 * <!-- end-user-doc -->
185 * @generated
187 @Override
188 public void eUnset(int featureID) {
189 switch (featureID) {
190 case ComparePackage.RESOURCE_LOCATION_CHANGE__BASE_LOCATION:
191 setBaseLocation(BASE_LOCATION_EDEFAULT);
192 return;
193 case ComparePackage.RESOURCE_LOCATION_CHANGE__CHANGED_LOCATION:
194 setChangedLocation(CHANGED_LOCATION_EDEFAULT);
195 return;
197 super.eUnset(featureID);
201 * <!-- begin-user-doc -->
202 * <!-- end-user-doc -->
203 * @generated
205 @Override
206 public boolean eIsSet(int featureID) {
207 switch (featureID) {
208 case ComparePackage.RESOURCE_LOCATION_CHANGE__BASE_LOCATION:
209 return BASE_LOCATION_EDEFAULT == null ? baseLocation != null : !BASE_LOCATION_EDEFAULT
210 .equals(baseLocation);
211 case ComparePackage.RESOURCE_LOCATION_CHANGE__CHANGED_LOCATION:
212 return CHANGED_LOCATION_EDEFAULT == null ? changedLocation != null
213 : !CHANGED_LOCATION_EDEFAULT.equals(changedLocation);
215 return super.eIsSet(featureID);
219 * <!-- begin-user-doc -->
220 * <!-- end-user-doc -->
221 * @generated
223 @Override
224 public String toString() {
225 if (eIsProxy())
226 return super.toString();
228 StringBuffer result = new StringBuffer(super.toString());
229 result.append(" (baseLocation: "); //$NON-NLS-1$
230 result.append(baseLocation);
231 result.append(", changedLocation: "); //$NON-NLS-1$
232 result.append(changedLocation);
233 result.append(')');
234 return result.toString();
237 } //ResourceLocationChangeImpl