RDL-Editor/com.minres.rdl.parent/com.minres.rdl/src-gen/com/minres/rdl/rdl/impl/ImmediateInstantiationImpl....

242 lines
6.0 KiB
Java

/**
* generated by Xtext 2.12.0
*/
package com.minres.rdl.rdl.impl;
import com.minres.rdl.rdl.ComponentInstance;
import com.minres.rdl.rdl.ImmediateInstantiation;
import com.minres.rdl.rdl.RdlPackage;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Immediate Instantiation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link com.minres.rdl.rdl.impl.ImmediateInstantiationImpl#isExternal <em>External</em>}</li>
* <li>{@link com.minres.rdl.rdl.impl.ImmediateInstantiationImpl#getComponentInstances <em>Component Instances</em>}</li>
* </ul>
*
* @generated
*/
public class ImmediateInstantiationImpl extends MinimalEObjectImpl.Container implements ImmediateInstantiation
{
/**
* The default value of the '{@link #isExternal() <em>External</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExternal()
* @generated
* @ordered
*/
protected static final boolean EXTERNAL_EDEFAULT = false;
/**
* The cached value of the '{@link #isExternal() <em>External</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isExternal()
* @generated
* @ordered
*/
protected boolean external = EXTERNAL_EDEFAULT;
/**
* The cached value of the '{@link #getComponentInstances() <em>Component Instances</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComponentInstances()
* @generated
* @ordered
*/
protected EList<ComponentInstance> componentInstances;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ImmediateInstantiationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return RdlPackage.Literals.IMMEDIATE_INSTANTIATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isExternal()
{
return external;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExternal(boolean newExternal)
{
boolean oldExternal = external;
external = newExternal;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RdlPackage.IMMEDIATE_INSTANTIATION__EXTERNAL, oldExternal, external));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<ComponentInstance> getComponentInstances()
{
if (componentInstances == null)
{
componentInstances = new EObjectContainmentEList<ComponentInstance>(ComponentInstance.class, this, RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES);
}
return componentInstances;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES:
return ((InternalEList<?>)getComponentInstances()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case RdlPackage.IMMEDIATE_INSTANTIATION__EXTERNAL:
return isExternal();
case RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES:
return getComponentInstances();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case RdlPackage.IMMEDIATE_INSTANTIATION__EXTERNAL:
setExternal((Boolean)newValue);
return;
case RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES:
getComponentInstances().clear();
getComponentInstances().addAll((Collection<? extends ComponentInstance>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case RdlPackage.IMMEDIATE_INSTANTIATION__EXTERNAL:
setExternal(EXTERNAL_EDEFAULT);
return;
case RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES:
getComponentInstances().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case RdlPackage.IMMEDIATE_INSTANTIATION__EXTERNAL:
return external != EXTERNAL_EDEFAULT;
case RdlPackage.IMMEDIATE_INSTANTIATION__COMPONENT_INSTANCES:
return componentInstances != null && !componentInstances.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (external: ");
result.append(external);
result.append(')');
return result.toString();
}
} //ImmediateInstantiationImpl