/**
*/
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:
*
*
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialImpl#getId Id}
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialImpl#getName Name}
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialImpl#getDensity Density}
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialImpl#getHeatCapacity Heat Capacity}
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialImpl#getConductivity Conductivity}
*
*
* @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 int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected int 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 double DENSITY_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getDensity() Density}' attribute.
*
*
* @see #getDensity()
* @generated
* @ordered
*/
protected double 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 double CONDUCTIVITY_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getConductivity() Conductivity}' attribute.
*
*
* @see #getConductivity()
* @generated
* @ordered
*/
protected double conductivity = CONDUCTIVITY_EDEFAULT;
/**
*
*
* @generated
*/
protected MaterialImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BuildingPhysicsPackage.Literals.MATERIAL;
}
/**
*
*
* @generated
*/
@Override
public int getId() {
return id;
}
/**
*
*
* @generated
*/
@Override
public void setId(int newId) {
int 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 double getDensity() {
return density;
}
/**
*
*
* @generated
*/
@Override
public void setDensity(double newDensity) {
double 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 double getConductivity() {
return conductivity;
}
/**
*
*
* @generated
*/
@Override
public void setConductivity(double newConductivity) {
double 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((Integer) newValue);
return;
case BuildingPhysicsPackage.MATERIAL__NAME:
setName((String) newValue);
return;
case BuildingPhysicsPackage.MATERIAL__DENSITY:
setDensity((Double) newValue);
return;
case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY:
setHeatCapacity((NullableQuantity) newValue);
return;
case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY:
setConductivity((Double) 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 != DENSITY_EDEFAULT;
case BuildingPhysicsPackage.MATERIAL__HEAT_CAPACITY:
return HEAT_CAPACITY_EDEFAULT == null ? heatCapacity != null : !HEAT_CAPACITY_EDEFAULT.equals(heatCapacity);
case BuildingPhysicsPackage.MATERIAL__CONDUCTIVITY:
return conductivity != CONDUCTIVITY_EDEFAULT;
}
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