/** */ package de.hftstuttgart.buildingphysics.impl; import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage; import de.hftstuttgart.buildingphysics.Material; import de.hftstuttgart.cityunits.model.NullableQuantity; import de.hftstuttgart.cityunits.model.quantities.QuantitiesFactory; import de.hftstuttgart.cityunits.model.quantities.QuantitiesPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * * An implementation of the model object 'Material'. * *

* The following features are implemented: *

* * * @generated */ public class MaterialImpl extends MinimalEObjectImpl.Container implements Material { /** * The default value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected static final long ID_EDEFAULT = 0L; /** * The cached value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected long id = 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 default value of the '{@link #getDensity() Density}' attribute. * * * @see #getDensity() * @generated * @ordered */ protected static final NullableQuantity DENSITY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "kg/m\u00b3"); /** * The cached value of the '{@link #getDensity() Density}' attribute. * * * @see #getDensity() * @generated * @ordered */ protected NullableQuantity density = DENSITY_EDEFAULT; /** * The default value of the '{@link #getHeatCapacity() Heat Capacity}' attribute. * * * @see #getHeatCapacity() * @generated * @ordered */ protected static final NullableQuantity HEAT_CAPACITY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "J/K"); /** * The cached value of the '{@link #getHeatCapacity() Heat Capacity}' attribute. * * * @see #getHeatCapacity() * @generated * @ordered */ protected NullableQuantity heatCapacity = HEAT_CAPACITY_EDEFAULT; /** * The default value of the '{@link #getConductivity() Conductivity}' attribute. * * * @see #getConductivity() * @generated * @ordered */ protected static final NullableQuantity CONDUCTIVITY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "W/(m*K)"); /** * The cached value of the '{@link #getConductivity() Conductivity}' attribute. * * * @see #getConductivity() * @generated * @ordered */ protected NullableQuantity conductivity = CONDUCTIVITY_EDEFAULT; /** * * * @generated */ protected MaterialImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BuildingPhysicsPackage.Literals.MATERIAL; } /** * * * @generated */ @Override public long getId() { return id; } /** * * * @generated */ @Override public void setId(long newId) { long oldId = id; id = newId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__ID, oldId, id)); } /** * * * @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.MATERIAL__NAME, oldName, name)); } /** * * * @generated */ @Override public NullableQuantity getDensity() { return density; } /** * * * @generated */ @Override public void setDensity(NullableQuantity newDensity) { NullableQuantity oldDensity = density; density = newDensity; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__DENSITY, oldDensity, density)); } /** * * * @generated */ @Override public NullableQuantity getHeatCapacity() { return heatCapacity; } /** * * * @generated */ @Override public void setHeatCapacity(NullableQuantity newHeatCapacity) { NullableQuantity oldHeatCapacity = heatCapacity; heatCapacity = newHeatCapacity; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY, oldHeatCapacity, heatCapacity)); } /** * * * @generated */ @Override public NullableQuantity getConductivity() { return conductivity; } /** * * * @generated */ @Override public void setConductivity(NullableQuantity newConductivity) { NullableQuantity oldConductivity = conductivity; conductivity = newConductivity; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY, oldConductivity, conductivity)); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__ID: return getId(); case BuildingPhysicsPackage.MATERIAL__NAME: return getName(); case BuildingPhysicsPackage.MATERIAL__DENSITY: return getDensity(); case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY: return getHeatCapacity(); case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY: return getConductivity(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__ID: setId((Long) newValue); return; case BuildingPhysicsPackage.MATERIAL__NAME: setName((String) newValue); return; case BuildingPhysicsPackage.MATERIAL__DENSITY: setDensity((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY: setHeatCapacity((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY: setConductivity((NullableQuantity) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__ID: setId(ID_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__NAME: setName(NAME_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__DENSITY: setDensity(DENSITY_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY: setHeatCapacity(HEAT_CAPACITY_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY: setConductivity(CONDUCTIVITY_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__ID: return id != ID_EDEFAULT; case BuildingPhysicsPackage.MATERIAL__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case BuildingPhysicsPackage.MATERIAL__DENSITY: return DENSITY_EDEFAULT == null ? density != null : !DENSITY_EDEFAULT.equals(density); case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY: return HEAT_CAPACITY_EDEFAULT == null ? heatCapacity != null : !HEAT_CAPACITY_EDEFAULT.equals(heatCapacity); case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY: return CONDUCTIVITY_EDEFAULT == null ? conductivity != null : !CONDUCTIVITY_EDEFAULT.equals(conductivity); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(", name: "); result.append(name); result.append(", density: "); result.append(density); result.append(", heatCapacity: "); result.append(heatCapacity); result.append(", conductivity: "); result.append(conductivity); result.append(')'); return result.toString(); } } //MaterialImpl