| /** |
| */ |
| package nestedcondition.impl; |
| |
| import graph.Graph; |
| |
| import java.util.Collection; |
| |
| import nestedcondition.NestedCondition; |
| import nestedcondition.NestedconditionPackage; |
| import nestedcondition.Variable; |
| |
| 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>Nested Condition</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link nestedcondition.impl.NestedConditionImpl#getVariables <em>Variables</em>}</li> |
| * <li>{@link nestedcondition.impl.NestedConditionImpl#getDomain <em>Domain</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class NestedConditionImpl extends MinimalEObjectImpl.Container implements NestedCondition { |
| /** |
| * The cached value of the '{@link #getVariables() <em>Variables</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVariables() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Variable> variables; |
| |
| /** |
| * The cached value of the '{@link #getDomain() <em>Domain</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDomain() |
| * @generated |
| * @ordered |
| */ |
| protected Graph domain; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected NestedConditionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return NestedconditionPackage.Literals.NESTED_CONDITION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Variable> getVariables() { |
| if (variables == null) { |
| variables = new EObjectContainmentEList<Variable>(Variable.class, this, NestedconditionPackage.NESTED_CONDITION__VARIABLES); |
| } |
| return variables; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Graph getDomain() { |
| if (domain != null && domain.eIsProxy()) { |
| InternalEObject oldDomain = (InternalEObject)domain; |
| domain = (Graph)eResolveProxy(oldDomain); |
| if (domain != oldDomain) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, NestedconditionPackage.NESTED_CONDITION__DOMAIN, oldDomain, domain)); |
| } |
| } |
| return domain; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Graph basicGetDomain() { |
| return domain; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDomain(Graph newDomain) { |
| Graph oldDomain = domain; |
| domain = newDomain; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NestedconditionPackage.NESTED_CONDITION__DOMAIN, oldDomain, domain)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case NestedconditionPackage.NESTED_CONDITION__VARIABLES: |
| return ((InternalEList<?>)getVariables()).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 NestedconditionPackage.NESTED_CONDITION__VARIABLES: |
| return getVariables(); |
| case NestedconditionPackage.NESTED_CONDITION__DOMAIN: |
| if (resolve) return getDomain(); |
| return basicGetDomain(); |
| } |
| 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 NestedconditionPackage.NESTED_CONDITION__VARIABLES: |
| getVariables().clear(); |
| getVariables().addAll((Collection<? extends Variable>)newValue); |
| return; |
| case NestedconditionPackage.NESTED_CONDITION__DOMAIN: |
| setDomain((Graph)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case NestedconditionPackage.NESTED_CONDITION__VARIABLES: |
| getVariables().clear(); |
| return; |
| case NestedconditionPackage.NESTED_CONDITION__DOMAIN: |
| setDomain((Graph)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case NestedconditionPackage.NESTED_CONDITION__VARIABLES: |
| return variables != null && !variables.isEmpty(); |
| case NestedconditionPackage.NESTED_CONDITION__DOMAIN: |
| return domain != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //NestedConditionImpl |