/**
*/
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.CyberPhysicalSystem;
import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
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.EStructuralFeature;
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}
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHosts Hosts}
* - {@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplications Applications}
*
*
* @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;
/**
* The cached setting delegate for the '{@link #getHosts() Hosts}' reference list.
*
*
* @see #getHosts()
* @generated
* @ordered
*/
protected EStructuralFeature.Internal.SettingDelegate HOSTS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__HOSTS)
.getSettingDelegate();
/**
* The cached setting delegate for the '{@link #getApplications() Applications}' reference list.
*
*
* @see #getApplications()
* @generated
* @ordered
*/
protected EStructuralFeature.Internal.SettingDelegate APPLICATIONS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__APPLICATIONS)
.getSettingDelegate();
/**
*
*
* @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
*/
@SuppressWarnings("unchecked")
@Override
public EList getHosts() {
return (EList) HOSTS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getApplications() {
return (EList) APPLICATIONS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
}
/**
*
*
* @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();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
return getHosts();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
return getApplications();
}
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();
case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
return HOSTS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
return APPLICATIONS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
}
return super.eIsSet(featureID);
}
} //CyberPhysicalSystemImpl