/**
*/
package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Application Type'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getInstances Instances}
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getRequirements Requirements}
*
*
* @generated
*/
public class ApplicationTypeImpl extends MinimalEObjectImpl.Container implements ApplicationType {
/**
* The cached value of the '{@link #getInstances() Instances}' containment reference list.
*
*
* @see #getInstances()
* @generated
* @ordered
*/
protected EList instances;
/**
* The cached value of the '{@link #getRequirements() Requirements}' containment reference list.
*
*
* @see #getRequirements()
* @generated
* @ordered
*/
protected EList requirements;
/**
*
*
* @generated
*/
protected ApplicationTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CpsPackage.Literals.APPLICATION_TYPE;
}
/**
*
*
* @generated
*/
@Override
public EList getInstances() {
if (instances == null) {
instances = new EObjectContainmentWithInverseEList(ApplicationInstance.class, this,
CpsPackage.APPLICATION_TYPE__INSTANCES, CpsPackage.APPLICATION_INSTANCE__TYPE);
}
return instances;
}
/**
*
*
* @generated
*/
@Override
public EList getRequirements() {
if (requirements == null) {
requirements = new EObjectContainmentEList(ResourceRequirement.class, this,
CpsPackage.APPLICATION_TYPE__REQUIREMENTS);
}
return requirements;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
return ((InternalEList) (InternalEList>) getInstances()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
return ((InternalEList>) getInstances()).basicRemove(otherEnd, msgs);
case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
return ((InternalEList>) getRequirements()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
return getInstances();
case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
return getRequirements();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
getInstances().clear();
getInstances().addAll((Collection extends ApplicationInstance>) newValue);
return;
case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
getRequirements().clear();
getRequirements().addAll((Collection extends ResourceRequirement>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
getInstances().clear();
return;
case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
getRequirements().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CpsPackage.APPLICATION_TYPE__INSTANCES:
return instances != null && !instances.isEmpty();
case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
return requirements != null && !requirements.isEmpty();
}
return super.eIsSet(featureID);
}
} //ApplicationTypeImpl