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

import demo.catalog.democatalog.DemoCatalogPackage;
import demo.catalog.democatalog.SolarPanel;

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>Solar Panel</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link demo.catalog.democatalog.impl.SolarPanelImpl#getNominalPower <em>Nominal Power</em>}</li>
 * </ul>
 *
 * @generated
 */
public class SolarPanelImpl extends EnergyComponentImpl implements SolarPanel {
	/**
	 * The default value of the '{@link #getNominalPower() <em>Nominal Power</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNominalPower()
	 * @generated
	 * @ordered
	 */
	protected static final double NOMINAL_POWER_EDEFAULT = 0.0;

	/**
	 * The cached value of the '{@link #getNominalPower() <em>Nominal Power</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNominalPower()
	 * @generated
	 * @ordered
	 */
	protected double nominalPower = NOMINAL_POWER_EDEFAULT;

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

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

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

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNominalPower(double newNominalPower) {
		double oldNominalPower = nominalPower;
		nominalPower = newNominalPower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DemoCatalogPackage.SOLAR_PANEL__NOMINAL_POWER,
					oldNominalPower, nominalPower));
	}

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

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

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

} //SolarPanelImpl
