Commit abd22a67 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Demo catalog with data model and generated classes

parent d9b6ae6f
/**
*/
package demo.catalog.democatalog;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Solar Panel</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link demo.catalog.democatalog.SolarPanel#getNominalPower <em>Nominal Power</em>}</li>
* </ul>
*
* @see demo.catalog.democatalog.democatalogPackage#getSolarPanel()
* @model
* @generated
*/
public interface SolarPanel extends EnergyComponent {
/**
* Returns the value of the '<em><b>Nominal Power</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the value of the '<em>Nominal Power</em>' attribute.
* @see #setNominalPower(double)
* @see demo.catalog.democatalog.democatalogPackage#getSolarPanel_NominalPower()
* @model required="true"
* @generated
*/
double getNominalPower();
/**
* Sets the value of the '{@link demo.catalog.democatalog.SolarPanel#getNominalPower <em>Nominal Power</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Nominal Power</em>' attribute.
* @see #getNominalPower()
* @generated
*/
void setNominalPower(double value);
} // SolarPanel
/**
*/
package demo.catalog.democatalog;
import org.eclipse.emf.ecore.EFactory;
/**
* <!-- begin-user-doc -->
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
* @see demo.catalog.democatalog.democatalogPackage
* @generated
*/
public interface democatalogFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
democatalogFactory eINSTANCE = demo.catalog.democatalog.impl.democatalogFactoryImpl.init();
/**
* Returns a new object of class '<em>Energy Components Catalog</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Energy Components Catalog</em>'.
* @generated
*/
EnergyComponentsCatalog createEnergyComponentsCatalog();
/**
* Returns a new object of class '<em>Boiler</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Boiler</em>'.
* @generated
*/
Boiler createBoiler();
/**
* Returns a new object of class '<em>Combined Heat Power</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Combined Heat Power</em>'.
* @generated
*/
CombinedHeatPower createCombinedHeatPower();
/**
* Returns a new object of class '<em>Solar Panel</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Solar Panel</em>'.
* @generated
*/
SolarPanel createSolarPanel();
/**
* Returns a new object of class '<em>Inverter</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Inverter</em>'.
* @generated
*/
Inverter createInverter();
/**
* Returns a new object of class '<em>Manufacturer</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return a new object of class '<em>Manufacturer</em>'.
* @generated
*/
Manufacturer createManufacturer();
/**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
democatalogPackage getdemocatalogPackage();
} //democatalogFactory
/**
*/
package demo.catalog.democatalog.impl;
import demo.catalog.democatalog.Boiler;
import demo.catalog.democatalog.BoilerType;
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>Boiler</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link demo.catalog.democatalog.impl.BoilerImpl#getBoilerType <em>Boiler Type</em>}</li>
* </ul>
*
* @generated
*/
public class BoilerImpl extends ChemicalEnergyDeviceImpl implements Boiler {
/**
* The default value of the '{@link #getBoilerType() <em>Boiler Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBoilerType()
* @generated
* @ordered
*/
protected static final BoilerType BOILER_TYPE_EDEFAULT = BoilerType.LOW_TEMPERATURE;
/**
* The cached value of the '{@link #getBoilerType() <em>Boiler Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBoilerType()
* @generated
* @ordered
*/
protected BoilerType boilerType = BOILER_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected BoilerImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return democatalogPackage.Literals.BOILER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BoilerType getBoilerType() {
return boilerType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBoilerType(BoilerType newBoilerType) {
BoilerType oldBoilerType = boilerType;
boilerType = newBoilerType == null ? BOILER_TYPE_EDEFAULT : newBoilerType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, democatalogPackage.BOILER__BOILER_TYPE, oldBoilerType,
boilerType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case democatalogPackage.BOILER__BOILER_TYPE:
return getBoilerType();
}
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.BOILER__BOILER_TYPE:
setBoilerType((BoilerType) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case democatalogPackage.BOILER__BOILER_TYPE:
setBoilerType(BOILER_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case democatalogPackage.BOILER__BOILER_TYPE:
return boilerType != BOILER_TYPE_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(" (boilerType: ");
result.append(boilerType);
result.append(')');
return result.toString();
}
} //BoilerImpl
/**
*/
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment