/** */ package de.hftstuttgart.buildingphysics.impl; import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage; import de.hftstuttgart.buildingphysics.Layer; import de.hftstuttgart.buildingphysics.Mounting; 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 'Mounting'. * *

* The following features are implemented: *

* * * @generated */ public class MountingImpl extends MinimalEObjectImpl.Container implements Mounting { /** * The default value of the '{@link #getMountingId() Mounting Id}' attribute. * * * @see #getMountingId() * @generated * @ordered */ protected static final String MOUNTING_ID_EDEFAULT = null; /** * The cached value of the '{@link #getMountingId() Mounting Id}' attribute. * * * @see #getMountingId() * @generated * @ordered */ protected String mountingId = MOUNTING_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 MountingImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BuildingPhysicsPackage.Literals.MOUNTING; } /** * * * @generated */ @Override public String getMountingId() { return mountingId; } /** * * * @generated */ @Override public void setMountingId(String newMountingId) { String oldMountingId = mountingId; mountingId = newMountingId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MOUNTING__MOUNTING_ID, oldMountingId, mountingId)); } /** * * * @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.MOUNTING__NAME, oldName, name)); } /** * * * @generated */ @Override public EList getLayers() { if (layers == null) { layers = new EObjectContainmentEList(Layer.class, this, BuildingPhysicsPackage.MOUNTING__LAYERS); } return layers; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.MOUNTING__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.MOUNTING__MOUNTING_ID: return getMountingId(); case BuildingPhysicsPackage.MOUNTING__NAME: return getName(); case BuildingPhysicsPackage.MOUNTING__LAYERS: return getLayers(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BuildingPhysicsPackage.MOUNTING__MOUNTING_ID: setMountingId((String) newValue); return; case BuildingPhysicsPackage.MOUNTING__NAME: setName((String) newValue); return; case BuildingPhysicsPackage.MOUNTING__LAYERS: getLayers().clear(); getLayers().addAll((Collection) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MOUNTING__MOUNTING_ID: setMountingId(MOUNTING_ID_EDEFAULT); return; case BuildingPhysicsPackage.MOUNTING__NAME: setName(NAME_EDEFAULT); return; case BuildingPhysicsPackage.MOUNTING__LAYERS: getLayers().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MOUNTING__MOUNTING_ID: return MOUNTING_ID_EDEFAULT == null ? mountingId != null : !MOUNTING_ID_EDEFAULT.equals(mountingId); case BuildingPhysicsPackage.MOUNTING__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case BuildingPhysicsPackage.MOUNTING__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(" (mountingId: "); result.append(mountingId); result.append(", name: "); result.append(name); result.append(')'); return result.toString(); } } //MountingImpl