/**
*/
package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
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.CyberPhysicalSystem;
import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
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.InternalEList;
/**
*
* An implementation of the model object 'Cyber Physical System'.
*
*
* The following features are implemented:
*
*
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests Requests}
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes Application Types}
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes Host Types}
*
*
* @generated
*/
public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implements CyberPhysicalSystem {
/**
* The cached value of the '{@link #getRequests() Requests}' containment reference list.
*
*
* @see #getRequests()
* @generated
* @ordered
*/
protected EList requests;
/**
* The cached value of the '{@link #getApplicationTypes() Application Types}' containment reference list.
*
*
* @see #getApplicationTypes()
* @generated
* @ordered
*/
protected EList applicationTypes;
/**
* The cached value of the '{@link #getHostTypes() Host Types}' containment reference list.
*
*
* @see #getHostTypes()
* @generated
* @ordered
*/
protected EList hostTypes;
/**
*
*
* @generated
*/
protected CyberPhysicalSystemImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM;
}
/**
*
*
* @generated
*/
@Override
public EList getRequests() {
if (requests == null) {
requests = new EObjectContainmentEList(Request.class, this,
CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS);
}
return requests;
}
/**
*
*
* @generated
*/
@Override
public EList getApplicationTypes() {
if (applicationTypes == null) {
applicationTypes = new EObjectContainmentEList(ApplicationType.class, this,
CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES);
}
return applicationTypes;
}
/**
*
*
* @generated
*/
@Override
public EList getHostTypes() {
if (hostTypes == null) {
hostTypes = new EObjectContainmentEList(HostType.class, this,
CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES);
}
return hostTypes;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
return ((InternalEList>) getRequests()).basicRemove(otherEnd, msgs);
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
return ((InternalEList>) getApplicationTypes()).basicRemove(otherEnd, msgs);
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
return ((InternalEList>) getHostTypes()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
return getRequests();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
return getApplicationTypes();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
return getHostTypes();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
getRequests().clear();
getRequests().addAll((Collection extends Request>) newValue);
return;
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
getApplicationTypes().clear();
getApplicationTypes().addAll((Collection extends ApplicationType>) newValue);
return;
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
getHostTypes().clear();
getHostTypes().addAll((Collection extends HostType>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
getRequests().clear();
return;
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
getApplicationTypes().clear();
return;
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
getHostTypes().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
return requests != null && !requests.isEmpty();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
return applicationTypes != null && !applicationTypes.isEmpty();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
return hostTypes != null && !hostTypes.isEmpty();
}
return super.eIsSet(featureID);
}
} //CyberPhysicalSystemImpl