| /** |
| * <copyright> |
| * |
| * Copyright (c) 2013, 2018 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - Initial API and implementation |
| * |
| * </copyright> |
| */ |
| package org.eclipse.qvtd.xtext.qvtcorecs.impl; |
| |
| 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.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.jdt.annotation.NonNull; |
| |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| |
| import org.eclipse.qvtd.xtext.qvtcorecs.BottomPatternCS; |
| import org.eclipse.qvtd.xtext.qvtcorecs.EnforcementOperationCS; |
| import org.eclipse.qvtd.xtext.qvtcorecs.PredicateOrAssignmentCS; |
| import org.eclipse.qvtd.xtext.qvtcorecs.QVTcoreCSPackage; |
| import org.eclipse.qvtd.xtext.qvtcorecs.RealizedVariableCS; |
| |
| import org.eclipse.qvtd.xtext.qvtcorecs.util.QVTcoreCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Bottom Pattern CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorecs.impl.BottomPatternCSImpl#getOwnedEnforcementOperations <em>Owned Enforcement Operations</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorecs.impl.BottomPatternCSImpl#getOwnedRealizedVariables <em>Owned Realized Variables</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtcorecs.impl.BottomPatternCSImpl#getOwnedConstraints <em>Owned Constraints</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BottomPatternCSImpl extends PatternCSImpl implements BottomPatternCS { |
| /** |
| * The number of structural features of the '<em>Bottom Pattern CS</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int BOTTOM_PATTERN_CS_FEATURE_COUNT = PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 3; |
| |
| /** |
| * The cached value of the '{@link #getOwnedEnforcementOperations() <em>Owned Enforcement Operations</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedEnforcementOperations() |
| * @generated |
| * @ordered |
| */ |
| protected EList<EnforcementOperationCS> ownedEnforcementOperations; |
| |
| /** |
| * The cached value of the '{@link #getOwnedRealizedVariables() <em>Owned Realized Variables</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedRealizedVariables() |
| * @generated |
| * @ordered |
| */ |
| protected EList<RealizedVariableCS> ownedRealizedVariables; |
| |
| /** |
| * The cached value of the '{@link #getOwnedConstraints() <em>Owned Constraints</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOwnedConstraints() |
| * @generated |
| * @ordered |
| */ |
| protected EList<PredicateOrAssignmentCS> ownedConstraints; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BottomPatternCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTcoreCSPackage.Literals.BOTTOM_PATTERN_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<EnforcementOperationCS> getOwnedEnforcementOperations() { |
| if (ownedEnforcementOperations == null) { |
| ownedEnforcementOperations = new EObjectContainmentEList<EnforcementOperationCS>(EnforcementOperationCS.class, this, PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0); |
| } |
| return ownedEnforcementOperations; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<RealizedVariableCS> getOwnedRealizedVariables() { |
| if (ownedRealizedVariables == null) { |
| ownedRealizedVariables = new EObjectContainmentEList<RealizedVariableCS>(RealizedVariableCS.class, this, PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1); |
| } |
| return ownedRealizedVariables; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<PredicateOrAssignmentCS> getOwnedConstraints() { |
| if (ownedConstraints == null) { |
| ownedConstraints = new EObjectContainmentEList<PredicateOrAssignmentCS>(PredicateOrAssignmentCS.class, this, PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2); |
| } |
| return ownedConstraints; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0: |
| return ((InternalEList<?>)getOwnedEnforcementOperations()).basicRemove(otherEnd, msgs); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1: |
| return ((InternalEList<?>)getOwnedRealizedVariables()).basicRemove(otherEnd, msgs); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2: |
| return ((InternalEList<?>)getOwnedConstraints()).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 PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0: |
| return getOwnedEnforcementOperations(); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1: |
| return getOwnedRealizedVariables(); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2: |
| return getOwnedConstraints(); |
| } |
| 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 PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0: |
| getOwnedEnforcementOperations().clear(); |
| getOwnedEnforcementOperations().addAll((Collection<? extends EnforcementOperationCS>)newValue); |
| return; |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1: |
| getOwnedRealizedVariables().clear(); |
| getOwnedRealizedVariables().addAll((Collection<? extends RealizedVariableCS>)newValue); |
| return; |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2: |
| getOwnedConstraints().clear(); |
| getOwnedConstraints().addAll((Collection<? extends PredicateOrAssignmentCS>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0: |
| getOwnedEnforcementOperations().clear(); |
| return; |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1: |
| getOwnedRealizedVariables().clear(); |
| return; |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2: |
| getOwnedConstraints().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 0: |
| return ownedEnforcementOperations != null && !ownedEnforcementOperations.isEmpty(); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 1: |
| return ownedRealizedVariables != null && !ownedRealizedVariables.isEmpty(); |
| case PatternCSImpl.PATTERN_CS_FEATURE_COUNT + 2: |
| return ownedConstraints != null && !ownedConstraints.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(@NonNull BaseCSVisitor<R> visitor) { |
| return (R) ((QVTcoreCSVisitor<?>)visitor).visitBottomPatternCS(this); |
| } |
| |
| } //BottomPatternCSImpl |