| /** |
| * <copyright> |
| * |
| * Copyright (c) 2013, 2019 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.qvtimperativecs.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.ocl.xtext.basecs.impl.NamedElementCSImpl; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.DirectionCS; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.QVTimperativeCSPackage; |
| import org.eclipse.qvtd.xtext.qvtimperativecs.util.QVTimperativeCSVisitor; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Direction CS</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.DirectionCSImpl#getImports <em>Imports</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.DirectionCSImpl#isIsChecked <em>Is Checked</em>}</li> |
| * <li>{@link org.eclipse.qvtd.xtext.qvtimperativecs.impl.DirectionCSImpl#isIsEnforced <em>Is Enforced</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DirectionCSImpl extends NamedElementCSImpl implements DirectionCS { |
| /** |
| * The number of structural features of the '<em>Direction CS</em>' class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @ordered |
| */ |
| public static final int DIRECTION_CS_FEATURE_COUNT = NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 3; |
| |
| /** |
| * The cached value of the '{@link #getImports() <em>Imports</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImports() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.ocl.pivot.Package> imports; |
| |
| /** |
| * The default value of the '{@link #isIsChecked() <em>Is Checked</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsChecked() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_CHECKED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsChecked() <em>Is Checked</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsChecked() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isChecked = IS_CHECKED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isIsEnforced() <em>Is Enforced</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsEnforced() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_ENFORCED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsEnforced() <em>Is Enforced</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsEnforced() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isEnforced = IS_ENFORCED_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DirectionCSImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return QVTimperativeCSPackage.Literals.DIRECTION_CS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<org.eclipse.ocl.pivot.Package> getImports() { |
| if (imports == null) { |
| imports = new EObjectResolvingEList<org.eclipse.ocl.pivot.Package>(org.eclipse.ocl.pivot.Package.class, this, NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 0); |
| } |
| return imports; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isIsChecked() { |
| return isChecked; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIsChecked(boolean newIsChecked) { |
| boolean oldIsChecked = isChecked; |
| isChecked = newIsChecked; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 1, oldIsChecked, isChecked)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean isIsEnforced() { |
| return isEnforced; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setIsEnforced(boolean newIsEnforced) { |
| boolean oldIsEnforced = isEnforced; |
| isEnforced = newIsEnforced; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 2, oldIsEnforced, isEnforced)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated NOT |
| */ |
| @Override |
| public String toString() { |
| return super.toString(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 0: |
| return getImports(); |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 1: |
| return isIsChecked(); |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 2: |
| return isIsEnforced(); |
| } |
| 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 NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 0: |
| getImports().clear(); |
| getImports().addAll((Collection<? extends org.eclipse.ocl.pivot.Package>)newValue); |
| return; |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 1: |
| setIsChecked((Boolean)newValue); |
| return; |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 2: |
| setIsEnforced((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 0: |
| getImports().clear(); |
| return; |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 1: |
| setIsChecked(IS_CHECKED_EDEFAULT); |
| return; |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 2: |
| setIsEnforced(IS_ENFORCED_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 0: |
| return imports != null && !imports.isEmpty(); |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 1: |
| return isChecked != IS_CHECKED_EDEFAULT; |
| case NamedElementCSImpl.NAMED_ELEMENT_CS_FEATURE_COUNT + 2: |
| return isEnforced != IS_ENFORCED_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public <R> R accept(@NonNull BaseCSVisitor<R> visitor) { |
| return (R) ((QVTimperativeCSVisitor<?>)visitor).visitDirectionCS(this); |
| } |
| |
| } //DirectionCSImpl |