/**
*/
package de.hftstuttgart.buildingphysics.impl;
import de.hftstuttgart.buildingphysics.BuildingPhysicsPackage;
import de.hftstuttgart.buildingphysics.MaterialCatalog;
import de.hftstuttgart.buildingphysics.MaterialCategory;
import java.util.Collection;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Material Catalog'.
*
*
* The following features are implemented:
*
*
* - {@link de.hftstuttgart.buildingphysics.impl.MaterialCatalogImpl#getMaterialCategories Material Categories}
*
*
* @generated
*/
public class MaterialCatalogImpl extends CatalogImpl implements MaterialCatalog {
/**
* The cached value of the '{@link #getMaterialCategories() Material Categories}' containment reference list.
*
*
* @see #getMaterialCategories()
* @generated
* @ordered
*/
protected EList materialCategories;
/**
*
*
* @generated
*/
protected MaterialCatalogImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return BuildingPhysicsPackage.Literals.MATERIAL_CATALOG;
}
/**
*
*
* @generated
*/
@Override
public EList getMaterialCategories() {
if (materialCategories == null) {
materialCategories = new EObjectContainmentEList(MaterialCategory.class, this,
BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES);
}
return materialCategories;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES:
return ((InternalEList>) getMaterialCategories()).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_CATALOG__MATERIAL_CATEGORIES:
return getMaterialCategories();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES:
getMaterialCategories().clear();
getMaterialCategories().addAll((Collection extends MaterialCategory>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES:
getMaterialCategories().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BuildingPhysicsPackage.MATERIAL_CATALOG__MATERIAL_CATEGORIES:
return materialCategories != null && !materialCategories.isEmpty();
}
return super.eIsSet(featureID);
}
} //MaterialCatalogImpl