/**
*/
package de.hftstuttgart.buildingphysics.impl;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.WindowType;
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.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
*
* An implementation of the model object 'Window Type'.
*
*
* The following features are implemented:
*
*
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getId Id}
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getName Name}
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getUValue UValue}
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getGValue GValue}
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getGlazingNumber Glazing Number}
* - {@link de.hftstuttgart.buildingphysics.impl.WindowTypeImpl#getFrameRatio Frame Ratio}
*
*
* @generated
*/
public class WindowTypeImpl extends MinimalEObjectImpl.Container implements WindowType {
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected int id = 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 #getUValue() UValue}' attribute.
*
*
* @see #getUValue()
* @generated
* @ordered
*/
protected static final NullableQuantity UVALUE_EDEFAULT = (NullableQuantity) QuantitiesFactory.eINSTANCE
.createFromString(QuantitiesPackage.eINSTANCE.getQuantityDouble(), "W/(m\u00b2\u00b7K)");
/**
* The cached value of the '{@link #getUValue() UValue}' attribute.
*
*
* @see #getUValue()
* @generated
* @ordered
*/
protected NullableQuantity uValue = UVALUE_EDEFAULT;
/**
* The default value of the '{@link #getGValue() GValue}' attribute.
*
*
* @see #getGValue()
* @generated
* @ordered
*/
protected static final double GVALUE_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getGValue() GValue}' attribute.
*
*
* @see #getGValue()
* @generated
* @ordered
*/
protected double gValue = GVALUE_EDEFAULT;
/**
* The default value of the '{@link #getGlazingNumber() Glazing Number}' attribute.
*
*
* @see #getGlazingNumber()
* @generated
* @ordered
*/
protected static final int GLAZING_NUMBER_EDEFAULT = 1;
/**
* The cached value of the '{@link #getGlazingNumber() Glazing Number}' attribute.
*
*
* @see #getGlazingNumber()
* @generated
* @ordered
*/
protected int glazingNumber = GLAZING_NUMBER_EDEFAULT;
/**
* The default value of the '{@link #getFrameRatio() Frame Ratio}' attribute.
*
*
* @see #getFrameRatio()
* @generated
* @ordered
*/
protected static final int FRAME_RATIO_EDEFAULT = 0;
/**
* The cached value of the '{@link #getFrameRatio() Frame Ratio}' attribute.
*
*
* @see #getFrameRatio()
* @generated
* @ordered
*/
protected int frameRatio = FRAME_RATIO_EDEFAULT;
/**
*
*
* @generated
*/
protected WindowTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BuildingPhysicsPackage.Literals.WINDOW_TYPE;
}
/**
*
*
* @generated
*/
@Override
public int getId() {
return id;
}
/**
*
*
* @generated
*/
@Override
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__ID, oldId, id));
}
/**
*
*
* @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.WINDOW_TYPE__NAME, oldName,
name));
}
/**
*
*
* @generated
*/
@Override
public NullableQuantity getUValue() {
return uValue;
}
/**
*
*
* @generated
*/
@Override
public void setUValue(NullableQuantity newUValue) {
NullableQuantity oldUValue = uValue;
uValue = newUValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__UVALUE, oldUValue,
uValue));
}
/**
*
*
* @generated
*/
@Override
public double getGValue() {
return gValue;
}
/**
*
*
* @generated
*/
@Override
public void setGValue(double newGValue) {
double oldGValue = gValue;
gValue = newGValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__GVALUE, oldGValue,
gValue));
}
/**
*
*
* @generated
*/
@Override
public int getGlazingNumber() {
return glazingNumber;
}
/**
*
*
* @generated
*/
@Override
public void setGlazingNumber(int newGlazingNumber) {
int oldGlazingNumber = glazingNumber;
glazingNumber = newGlazingNumber;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER,
oldGlazingNumber, glazingNumber));
}
/**
*
*
* @generated
*/
@Override
public int getFrameRatio() {
return frameRatio;
}
/**
*
*
* @generated
*/
@Override
public void setFrameRatio(int newFrameRatio) {
int oldFrameRatio = frameRatio;
frameRatio = newFrameRatio;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildingPhysicsPackage.WINDOW_TYPE__FRAME_RATIO,
oldFrameRatio, frameRatio));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BuildingPhysicsPackage.WINDOW_TYPE__ID:
return getId();
case BuildingPhysicsPackage.WINDOW_TYPE__NAME:
return getName();
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
return getUValue();
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
return getGValue();
case BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER:
return getGlazingNumber();
case BuildingPhysicsPackage.WINDOW_TYPE__FRAME_RATIO:
return getFrameRatio();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BuildingPhysicsPackage.WINDOW_TYPE__ID:
setId((Integer) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__NAME:
setName((String) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
setUValue((NullableQuantity) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
setGValue((Double) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER:
setGlazingNumber((Integer) newValue);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__FRAME_RATIO:
setFrameRatio((Integer) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BuildingPhysicsPackage.WINDOW_TYPE__ID:
setId(ID_EDEFAULT);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
setUValue(UVALUE_EDEFAULT);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
setGValue(GVALUE_EDEFAULT);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER:
setGlazingNumber(GLAZING_NUMBER_EDEFAULT);
return;
case BuildingPhysicsPackage.WINDOW_TYPE__FRAME_RATIO:
setFrameRatio(FRAME_RATIO_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BuildingPhysicsPackage.WINDOW_TYPE__ID:
return id != ID_EDEFAULT;
case BuildingPhysicsPackage.WINDOW_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case BuildingPhysicsPackage.WINDOW_TYPE__UVALUE:
return UVALUE_EDEFAULT == null ? uValue != null : !UVALUE_EDEFAULT.equals(uValue);
case BuildingPhysicsPackage.WINDOW_TYPE__GVALUE:
return gValue != GVALUE_EDEFAULT;
case BuildingPhysicsPackage.WINDOW_TYPE__GLAZING_NUMBER:
return glazingNumber != GLAZING_NUMBER_EDEFAULT;
case BuildingPhysicsPackage.WINDOW_TYPE__FRAME_RATIO:
return frameRatio != FRAME_RATIO_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (id: ");
result.append(id);
result.append(", name: ");
result.append(name);
result.append(", uValue: ");
result.append(uValue);
result.append(", gValue: ");
result.append(gValue);
result.append(", glazingNumber: ");
result.append(glazingNumber);
result.append(", frameRatio: ");
result.append(frameRatio);
result.append(')');
return result.toString();
}
} //WindowTypeImpl