ConstructionImpl.java 7.08 KB
Newer Older
1
2
3
4
5
/**
 */
package de.hftstuttgart.buildingphysics.impl;

import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
6
import de.hftstuttgart.buildingphysics.Construction;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import de.hftstuttgart.buildingphysics.Layer;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
27
 * An implementation of the model object '<em><b>Construction</b></em>'.
28
29
30
31
32
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
33
34
35
 *   <li>{@link de.hftstuttgart.buildingphysics.impl.ConstructionImpl#getConstructionId <em>Construction Id</em>}</li>
 *   <li>{@link de.hftstuttgart.buildingphysics.impl.ConstructionImpl#getName <em>Name</em>}</li>
 *   <li>{@link de.hftstuttgart.buildingphysics.impl.ConstructionImpl#getLayers <em>Layers</em>}</li>
36
37
38
39
 * </ul>
 *
 * @generated
 */
40
public class ConstructionImpl extends MinimalEObjectImpl.Container implements Construction {
41
	/**
42
	 * The default value of the '{@link #getConstructionId() <em>Construction Id</em>}' attribute.
43
44
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
45
	 * @see #getConstructionId()
46
47
48
	 * @generated
	 * @ordered
	 */
49
	protected static final String CONSTRUCTION_ID_EDEFAULT = null;
50
51

	/**
52
	 * The cached value of the '{@link #getConstructionId() <em>Construction Id</em>}' attribute.
53
54
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
55
	 * @see #getConstructionId()
56
57
58
	 * @generated
	 * @ordered
	 */
59
	protected String constructionId = CONSTRUCTION_ID_EDEFAULT;
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The cached value of the '{@link #getLayers() <em>Layers</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLayers()
	 * @generated
	 * @ordered
	 */
	protected EList<Layer> layers;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
96
	protected ConstructionImpl() {
97
98
99
100
101
102
103
104
105
106
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
107
		return BuildingPhysicsPackage.Literals.CONSTRUCTION;
108
109
110
111
112
113
114
115
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
116
117
	public String getConstructionId() {
		return constructionId;
118
119
120
121
122
123
124
125
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
126
127
128
	public void setConstructionId(String newConstructionId) {
		String oldConstructionId = constructionId;
		constructionId = newConstructionId;
129
		if (eNotificationRequired())
130
131
			eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID,
					oldConstructionId, constructionId));
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
154
			eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.CONSTRUCTION__NAME, oldName,
155
156
157
158
159
160
161
162
163
164
165
					name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EList<Layer> getLayers() {
		if (layers == null) {
166
			layers = new EObjectContainmentEList<Layer>(Layer.class, this, BuildingPhysicsPackage.CONSTRUCTION__LAYERS);
167
168
169
170
171
172
173
174
175
176
177
178
		}
		return layers;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
179
		case BuildingPhysicsPackage.CONSTRUCTION__LAYERS:
180
181
182
183
184
185
186
187
188
189
190
191
192
			return ((InternalEList<?>) getLayers()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
193
194
195
		case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID:
			return getConstructionId();
		case BuildingPhysicsPackage.CONSTRUCTION__NAME:
196
			return getName();
197
		case BuildingPhysicsPackage.CONSTRUCTION__LAYERS:
198
199
200
201
202
203
204
205
206
207
208
209
210
211
			return getLayers();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
212
213
		case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID:
			setConstructionId((String) newValue);
214
			return;
215
		case BuildingPhysicsPackage.CONSTRUCTION__NAME:
216
217
			setName((String) newValue);
			return;
218
		case BuildingPhysicsPackage.CONSTRUCTION__LAYERS:
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
			getLayers().clear();
			getLayers().addAll((Collection<? extends Layer>) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
234
235
		case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID:
			setConstructionId(CONSTRUCTION_ID_EDEFAULT);
236
			return;
237
		case BuildingPhysicsPackage.CONSTRUCTION__NAME:
238
239
			setName(NAME_EDEFAULT);
			return;
240
		case BuildingPhysicsPackage.CONSTRUCTION__LAYERS:
241
242
243
244
245
246
247
248
249
250
251
252
253
254
			getLayers().clear();
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
255
256
257
258
		case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID:
			return CONSTRUCTION_ID_EDEFAULT == null ? constructionId != null
					: !CONSTRUCTION_ID_EDEFAULT.equals(constructionId);
		case BuildingPhysicsPackage.CONSTRUCTION__NAME:
259
			return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
260
		case BuildingPhysicsPackage.CONSTRUCTION__LAYERS:
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
			return layers != null && !layers.isEmpty();
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy())
			return super.toString();

		StringBuilder result = new StringBuilder(super.toString());
277
278
		result.append(" (constructionId: ");
		result.append(constructionId);
279
280
281
282
283
284
		result.append(", name: ");
		result.append(name);
		result.append(')');
		return result.toString();
	}

285
} //ConstructionImpl