/** */ package de.hftstuttgart.buildingphysics.impl; import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage; import de.hftstuttgart.buildingphysics.Material; import de.hftstuttgart.buildingphysics.MaterialCategory; 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.common.notify.NotificationChain; 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.EcoreUtil; /** * * 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 #getMaterialId() Material Id}' attribute. * * * @see #getMaterialId() * @generated * @ordered */ protected static final String MATERIAL_ID_EDEFAULT = null; /** * The cached value of the '{@link #getMaterialId() Material Id}' attribute. * * * @see #getMaterialId() * @generated * @ordered */ protected String materialId = MATERIAL_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; /** * The default value of the '{@link #getEmbodiedEnergy() Embodied Energy}' attribute. * * * @see #getEmbodiedEnergy() * @generated * @ordered */ protected static final NullableQuantity EMBODIED_ENERGY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "kW*h/kg"); /** * The cached value of the '{@link #getEmbodiedEnergy() Embodied Energy}' attribute. * * * @see #getEmbodiedEnergy() * @generated * @ordered */ protected NullableQuantity embodiedEnergy = EMBODIED_ENERGY_EDEFAULT; /** * The default value of the '{@link #getEmbodiedCarbon() Embodied Carbon}' attribute. * * * @see #getEmbodiedCarbon() * @generated * @ordered */ protected static final NullableQuantity EMBODIED_CARBON_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "kgCO\u2082eq/kg"); /** * The cached value of the '{@link #getEmbodiedCarbon() Embodied Carbon}' attribute. * * * @see #getEmbodiedCarbon() * @generated * @ordered */ protected NullableQuantity embodiedCarbon = EMBODIED_CARBON_EDEFAULT; /** * The default value of the '{@link #getConstructionDescription() Construction Description}' attribute. * * * @see #getConstructionDescription() * @generated * @ordered */ protected static final String CONSTRUCTION_DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getConstructionDescription() Construction Description}' attribute. * * * @see #getConstructionDescription() * @generated * @ordered */ protected String constructionDescription = CONSTRUCTION_DESCRIPTION_EDEFAULT; /** * The default value of the '{@link #getDisposalEnergy() Disposal Energy}' attribute. * * * @see #getDisposalEnergy() * @generated * @ordered */ protected static final NullableQuantity DISPOSAL_ENERGY_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "kW*h/kg"); /** * The cached value of the '{@link #getDisposalEnergy() Disposal Energy}' attribute. * * * @see #getDisposalEnergy() * @generated * @ordered */ protected NullableQuantity disposalEnergy = DISPOSAL_ENERGY_EDEFAULT; /** * The default value of the '{@link #getDisposalCarbon() Disposal Carbon}' attribute. * * * @see #getDisposalCarbon() * @generated * @ordered */ protected static final NullableQuantity DISPOSAL_CARBON_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE .createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "kgCO\u2082eq/kg"); /** * The cached value of the '{@link #getDisposalCarbon() Disposal Carbon}' attribute. * * * @see #getDisposalCarbon() * @generated * @ordered */ protected NullableQuantity disposalCarbon = DISPOSAL_CARBON_EDEFAULT; /** * The default value of the '{@link #getDisposalDescription() Disposal Description}' attribute. * * * @see #getDisposalDescription() * @generated * @ordered */ protected static final String DISPOSAL_DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDisposalDescription() Disposal Description}' attribute. * * * @see #getDisposalDescription() * @generated * @ordered */ protected String disposalDescription = DISPOSAL_DESCRIPTION_EDEFAULT; /** * * * @generated */ protected MaterialImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BuildingPhysicsPackage.Literals.MATERIAL; } /** * * * @generated */ @Override public String getMaterialId() { return materialId; } /** * * * @generated */ @Override public void setMaterialId(String newMaterialId) { String oldMaterialId = materialId; materialId = newMaterialId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__MATERIAL_ID, oldMaterialId, materialId)); } /** * * * @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 NullableQuantity getEmbodiedEnergy() { return embodiedEnergy; } /** * * * @generated */ @Override public void setEmbodiedEnergy(NullableQuantity newEmbodiedEnergy) { NullableQuantity oldEmbodiedEnergy = embodiedEnergy; embodiedEnergy = newEmbodiedEnergy; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__EMBODIED_ENERGY, oldEmbodiedEnergy, embodiedEnergy)); } /** * * * @generated */ @Override public NullableQuantity getEmbodiedCarbon() { return embodiedCarbon; } /** * * * @generated */ @Override public void setEmbodiedCarbon(NullableQuantity newEmbodiedCarbon) { NullableQuantity oldEmbodiedCarbon = embodiedCarbon; embodiedCarbon = newEmbodiedCarbon; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__EMBODIED_CARBON, oldEmbodiedCarbon, embodiedCarbon)); } /** * * * @generated */ @Override public String getConstructionDescription() { return constructionDescription; } /** * * * @generated */ @Override public void setConstructionDescription(String newConstructionDescription) { String oldConstructionDescription = constructionDescription; constructionDescription = newConstructionDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__CONSTRUCTION_DESCRIPTION, oldConstructionDescription, constructionDescription)); } /** * * * @generated */ @Override public NullableQuantity getDisposalEnergy() { return disposalEnergy; } /** * * * @generated */ @Override public void setDisposalEnergy(NullableQuantity newDisposalEnergy) { NullableQuantity oldDisposalEnergy = disposalEnergy; disposalEnergy = newDisposalEnergy; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__DISPOSAL_ENERGY, oldDisposalEnergy, disposalEnergy)); } /** * * * @generated */ @Override public NullableQuantity getDisposalCarbon() { return disposalCarbon; } /** * * * @generated */ @Override public void setDisposalCarbon(NullableQuantity newDisposalCarbon) { NullableQuantity oldDisposalCarbon = disposalCarbon; disposalCarbon = newDisposalCarbon; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__DISPOSAL_CARBON, oldDisposalCarbon, disposalCarbon)); } /** * * * @generated */ @Override public String getDisposalDescription() { return disposalDescription; } /** * * * @generated */ @Override public void setDisposalDescription(String newDisposalDescription) { String oldDisposalDescription = disposalDescription; disposalDescription = newDisposalDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__DISPOSAL_DESCRIPTION, oldDisposalDescription, disposalDescription)); } /** * * * @generated */ @Override public MaterialCategory getCategory() { if (eContainerFeatureID() != BuildingPhysicsPackage.MATERIAL__CATEGORY) return null; return (MaterialCategory) eInternalContainer(); } /** * * * @generated */ public NotificationChain basicSetCategory(MaterialCategory newCategory, NotificationChain msgs) { msgs = eBasicSetContainer((InternalEObject) newCategory, BuildingPhysicsPackage.MATERIAL__CATEGORY, msgs); return msgs; } /** * * * @generated */ @Override public void setCategory(MaterialCategory newCategory) { if (newCategory != eInternalContainer() || (eContainerFeatureID() != BuildingPhysicsPackage.MATERIAL__CATEGORY && newCategory != null)) { if (EcoreUtil.isAncestor(this, newCategory)) throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); NotificationChain msgs = null; if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); if (newCategory != null) msgs = ((InternalEObject) newCategory).eInverseAdd(this, BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS, MaterialCategory.class, msgs); msgs = basicSetCategory(newCategory, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.MATERIAL__CATEGORY, newCategory, newCategory)); } /** * * * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__CATEGORY: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return basicSetCategory((MaterialCategory) otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__CATEGORY: return basicSetCategory(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case BuildingPhysicsPackage.MATERIAL__CATEGORY: return eInternalContainer().eInverseRemove(this, BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS, MaterialCategory.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__MATERIAL_ID: return getMaterialId(); 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(); case BuildingPhysicsPackage.MATERIAL__EMBODIED_ENERGY: return getEmbodiedEnergy(); case BuildingPhysicsPackage.MATERIAL__EMBODIED_CARBON: return getEmbodiedCarbon(); case BuildingPhysicsPackage.MATERIAL__CONSTRUCTION_DESCRIPTION: return getConstructionDescription(); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_ENERGY: return getDisposalEnergy(); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_CARBON: return getDisposalCarbon(); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_DESCRIPTION: return getDisposalDescription(); case BuildingPhysicsPackage.MATERIAL__CATEGORY: return getCategory(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__MATERIAL_ID: setMaterialId((String) 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; case BuildingPhysicsPackage.MATERIAL__EMBODIED_ENERGY: setEmbodiedEnergy((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__EMBODIED_CARBON: setEmbodiedCarbon((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__CONSTRUCTION_DESCRIPTION: setConstructionDescription((String) newValue); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_ENERGY: setDisposalEnergy((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_CARBON: setDisposalCarbon((NullableQuantity) newValue); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_DESCRIPTION: setDisposalDescription((String) newValue); return; case BuildingPhysicsPackage.MATERIAL__CATEGORY: setCategory((MaterialCategory) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__MATERIAL_ID: setMaterialId(MATERIAL_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; case BuildingPhysicsPackage.MATERIAL__EMBODIED_ENERGY: setEmbodiedEnergy(EMBODIED_ENERGY_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__EMBODIED_CARBON: setEmbodiedCarbon(EMBODIED_CARBON_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__CONSTRUCTION_DESCRIPTION: setConstructionDescription(CONSTRUCTION_DESCRIPTION_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_ENERGY: setDisposalEnergy(DISPOSAL_ENERGY_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_CARBON: setDisposalCarbon(DISPOSAL_CARBON_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__DISPOSAL_DESCRIPTION: setDisposalDescription(DISPOSAL_DESCRIPTION_EDEFAULT); return; case BuildingPhysicsPackage.MATERIAL__CATEGORY: setCategory((MaterialCategory) null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL__MATERIAL_ID: return MATERIAL_ID_EDEFAULT == null ? materialId != null : !MATERIAL_ID_EDEFAULT.equals(materialId); 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); case BuildingPhysicsPackage.MATERIAL__EMBODIED_ENERGY: return EMBODIED_ENERGY_EDEFAULT == null ? embodiedEnergy != null : !EMBODIED_ENERGY_EDEFAULT.equals(embodiedEnergy); case BuildingPhysicsPackage.MATERIAL__EMBODIED_CARBON: return EMBODIED_CARBON_EDEFAULT == null ? embodiedCarbon != null : !EMBODIED_CARBON_EDEFAULT.equals(embodiedCarbon); case BuildingPhysicsPackage.MATERIAL__CONSTRUCTION_DESCRIPTION: return CONSTRUCTION_DESCRIPTION_EDEFAULT == null ? constructionDescription != null : !CONSTRUCTION_DESCRIPTION_EDEFAULT.equals(constructionDescription); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_ENERGY: return DISPOSAL_ENERGY_EDEFAULT == null ? disposalEnergy != null : !DISPOSAL_ENERGY_EDEFAULT.equals(disposalEnergy); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_CARBON: return DISPOSAL_CARBON_EDEFAULT == null ? disposalCarbon != null : !DISPOSAL_CARBON_EDEFAULT.equals(disposalCarbon); case BuildingPhysicsPackage.MATERIAL__DISPOSAL_DESCRIPTION: return DISPOSAL_DESCRIPTION_EDEFAULT == null ? disposalDescription != null : !DISPOSAL_DESCRIPTION_EDEFAULT.equals(disposalDescription); case BuildingPhysicsPackage.MATERIAL__CATEGORY: return getCategory() != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (materialId: "); result.append(materialId); 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(", embodiedEnergy: "); result.append(embodiedEnergy); result.append(", embodiedCarbon: "); result.append(embodiedCarbon); result.append(", constructionDescription: "); result.append(constructionDescription); result.append(", disposalEnergy: "); result.append(disposalEnergy); result.append(", disposalCarbon: "); result.append(disposalCarbon); result.append(", disposalDescription: "); result.append(disposalDescription); result.append(')'); return result.toString(); } } //MaterialImpl