/** */ package de.hftstuttgart.buildingphysics.impl; import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage; import de.hftstuttgart.buildingphysics.Material; import de.hftstuttgart.buildingphysics.MaterialCategory; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'Material Category'. * *

* The following features are implemented: *

* * * @generated */ public class MaterialCategoryImpl extends MinimalEObjectImpl.Container implements MaterialCategory { /** * The cached value of the '{@link #getMaterials() Materials}' containment reference list. * * * @see #getMaterials() * @generated * @ordered */ protected EList materials; /** * 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; /** * * * @generated */ protected MaterialCategoryImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return BuildingPhysicsPackage.Literals.MATERIAL_CATEGORY; } /** * * * @generated */ @Override public EList getMaterials() { if (materials == null) { materials = new EObjectContainmentWithInverseEList(Material.class, this, BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS, BuildingPhysicsPackage.MATERIAL__CATEGORY); } return materials; } /** * * * @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.MATERIAL_CATEGORY__NAME, oldName, name)); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: return ((InternalEList) (InternalEList) getMaterials()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: return ((InternalEList) getMaterials()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: return getMaterials(); case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: getMaterials().clear(); getMaterials().addAll((Collection) newValue); return; case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: setName((String) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: getMaterials().clear(); return; case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case BuildingPhysicsPackage.MATERIAL_CATEGORY__MATERIALS: return materials != null && !materials.isEmpty(); case BuildingPhysicsPackage.MATERIAL_CATEGORY__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); result.append(" (name: "); result.append(name); result.append(')'); return result.toString(); } } //MaterialCategoryImpl