/**
 */
package demo.catalog.democatalog.impl;

import demo.catalog.democatalog.CombinedHeatPower;
import demo.catalog.democatalog.DemoCatalogPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Combined Heat Power</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link demo.catalog.democatalog.impl.CombinedHeatPowerImpl#getThermalEfficiency <em>Thermal Efficiency</em>}</li>
 * </ul>
 *
 * @generated
 */
public class CombinedHeatPowerImpl extends ChemicalEnergyDeviceImpl implements CombinedHeatPower {
	/**
	 * The default value of the '{@link #getThermalEfficiency() <em>Thermal Efficiency</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getThermalEfficiency()
	 * @generated
	 * @ordered
	 */
	protected static final double THERMAL_EFFICIENCY_EDEFAULT = 0.0;

	/**
	 * The cached value of the '{@link #getThermalEfficiency() <em>Thermal Efficiency</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getThermalEfficiency()
	 * @generated
	 * @ordered
	 */
	protected double thermalEfficiency = THERMAL_EFFICIENCY_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CombinedHeatPowerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DemoCatalogPackage.Literals.COMBINED_HEAT_POWER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public double getThermalEfficiency() {
		return thermalEfficiency;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setThermalEfficiency(double newThermalEfficiency) {
		double oldThermalEfficiency = thermalEfficiency;
		thermalEfficiency = newThermalEfficiency;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					DemoCatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY, oldThermalEfficiency,
					thermalEfficiency));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DemoCatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY:
			return getThermalEfficiency();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DemoCatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY:
			setThermalEfficiency((Double) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DemoCatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY:
			setThermalEfficiency(THERMAL_EFFICIENCY_EDEFAULT);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DemoCatalogPackage.COMBINED_HEAT_POWER__THERMAL_EFFICIENCY:
			return thermalEfficiency != THERMAL_EFFICIENCY_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy())
			return super.toString();

		StringBuilder result = new StringBuilder(super.toString());
		result.append(" (thermalEfficiency: ");
		result.append(thermalEfficiency);
		result.append(')');
		return result.toString();
	}

} //CombinedHeatPowerImpl
