/** */ package de.hftstuttgart.buildingphysics.impl; import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage; import de.hftstuttgart.buildingphysics.Construction; 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; /** * * An implementation of the model object 'Construction'. * *

* The following features are implemented: *

* * * @generated */ public class ConstructionImpl extends MinimalEObjectImpl.Container implements Construction { /** * The default value of the '{@link #getConstructionId() Construction Id}' attribute. * * * @see #getConstructionId() * @generated * @ordered */ protected static final String CONSTRUCTION_ID_EDEFAULT = null; /** * The cached value of the '{@link #getConstructionId() Construction Id}' attribute. * * * @see #getConstructionId() * @generated * @ordered */ protected String constructionId = CONSTRUCTION_ID_EDEFAULT; /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The cached value of the '{@link #getLayers() Layers}' containment reference list. * * * @see #getLayers() * @generated * @ordered */ protected EList layers; /** * * * @generated */ protected ConstructionImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BuildingPhysicsPackage.Literals.CONSTRUCTION; } /** * * * @generated */ @Override public String getConstructionId() { return constructionId; } /** * * * @generated */ @Override public void setConstructionId(String newConstructionId) { String oldConstructionId = constructionId; constructionId = newConstructionId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID, oldConstructionId, constructionId)); } /** * * * @generated */ @Override public String getName() { return name; } /** * * * @generated */ @Override public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.CONSTRUCTION__NAME, oldName, name)); } /** * * * @generated */ @Override public EList getLayers() { if (layers == null) { layers = new EObjectContainmentEList(Layer.class, this, BuildingPhysicsPackage.CONSTRUCTION__LAYERS); } return layers; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.CONSTRUCTION__LAYERS: return ((InternalEList) getLayers()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID: return getConstructionId(); case BuildingPhysicsPackage.CONSTRUCTION__NAME: return getName(); case BuildingPhysicsPackage.CONSTRUCTION__LAYERS: return getLayers(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID: setConstructionId((String) newValue); return; case BuildingPhysicsPackage.CONSTRUCTION__NAME: setName((String) newValue); return; case BuildingPhysicsPackage.CONSTRUCTION__LAYERS: getLayers().clear(); getLayers().addAll((Collection) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID: setConstructionId(CONSTRUCTION_ID_EDEFAULT); return; case BuildingPhysicsPackage.CONSTRUCTION__NAME: setName(NAME_EDEFAULT); return; case BuildingPhysicsPackage.CONSTRUCTION__LAYERS: getLayers().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuildingPhysicsPackage.CONSTRUCTION__CONSTRUCTION_ID: return CONSTRUCTION_ID_EDEFAULT == null ? constructionId != null : !CONSTRUCTION_ID_EDEFAULT.equals(constructionId); case BuildingPhysicsPackage.CONSTRUCTION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case BuildingPhysicsPackage.CONSTRUCTION__LAYERS: return layers != null && !layers.isEmpty(); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (constructionId: "); result.append(constructionId); result.append(", name: "); result.append(name); result.append(')'); return result.toString(); } } //ConstructionImpl