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

import demo.catalog.democatalog.ChemicalEnergyDevice;
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>Chemical Energy Device</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link demo.catalog.democatalog.impl.ChemicalEnergyDeviceImpl#getInstalledThermalPower <em>Installed Thermal Power</em>}</li>
 * </ul>
 *
 * @generated
 */
public abstract class ChemicalEnergyDeviceImpl extends EnergyComponentImpl implements ChemicalEnergyDevice {
	/**
	 * The default value of the '{@link #getInstalledThermalPower() <em>Installed Thermal Power</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInstalledThermalPower()
	 * @generated
	 * @ordered
	 */
	protected static final double INSTALLED_THERMAL_POWER_EDEFAULT = 0.0;

	/**
	 * The cached value of the '{@link #getInstalledThermalPower() <em>Installed Thermal Power</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInstalledThermalPower()
	 * @generated
	 * @ordered
	 */
	protected double installedThermalPower = INSTALLED_THERMAL_POWER_EDEFAULT;

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

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

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setInstalledThermalPower(double newInstalledThermalPower) {
		double oldInstalledThermalPower = installedThermalPower;
		installedThermalPower = newInstalledThermalPower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					DemoCatalogPackage.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER, oldInstalledThermalPower,
					installedThermalPower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DemoCatalogPackage.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER:
			return getInstalledThermalPower();
		}
		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.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER:
			setInstalledThermalPower((Double) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DemoCatalogPackage.CHEMICAL_ENERGY_DEVICE__INSTALLED_THERMAL_POWER:
			return installedThermalPower != INSTALLED_THERMAL_POWER_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(" (installedThermalPower: ");
		result.append(installedThermalPower);
		result.append(')');
		return result.toString();
	}

} //ChemicalEnergyDeviceImpl
