| /******************************************************************************* |
| * Copyright (c) 2013, 2016 CEA LIST and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * E.D.Willink(CEA LIST) - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ocl.examples.codegen.cgmodel.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.jdt.annotation.NonNull; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGModelPackage; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGTuplePartCallExp; |
| import org.eclipse.ocl.examples.codegen.cgmodel.CGValuedElement; |
| import org.eclipse.ocl.examples.codegen.cgmodel.util.CGModelVisitor; |
| import org.eclipse.ocl.pivot.ids.TuplePartId; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>CG Tuple Part Call Exp</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.ocl.examples.codegen.cgmodel.impl.CGTuplePartCallExpImpl#getAstTuplePartId <em>Ast Tuple Part Id</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CGTuplePartCallExpImpl extends CGPropertyCallExpImpl implements CGTuplePartCallExp { |
| /** |
| * The default value of the '{@link #getAstTuplePartId() <em>Ast Tuple Part Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAstTuplePartId() |
| * @generated |
| * @ordered |
| */ |
| protected static final TuplePartId AST_TUPLE_PART_ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAstTuplePartId() <em>Ast Tuple Part Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAstTuplePartId() |
| * @generated |
| * @ordered |
| */ |
| protected TuplePartId astTuplePartId = AST_TUPLE_PART_ID_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CGTuplePartCallExpImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CGModelPackage.Literals.CG_TUPLE_PART_CALL_EXP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public TuplePartId getAstTuplePartId() { |
| return astTuplePartId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setAstTuplePartId(TuplePartId newAstTuplePartId) { |
| TuplePartId oldAstTuplePartId = astTuplePartId; |
| astTuplePartId = newAstTuplePartId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CGModelPackage.CG_TUPLE_PART_CALL_EXP__AST_TUPLE_PART_ID, oldAstTuplePartId, astTuplePartId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @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 CGModelPackage.CG_TUPLE_PART_CALL_EXP__AST_TUPLE_PART_ID: |
| return getAstTuplePartId(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CGModelPackage.CG_TUPLE_PART_CALL_EXP__AST_TUPLE_PART_ID: |
| setAstTuplePartId((TuplePartId)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CGModelPackage.CG_TUPLE_PART_CALL_EXP__AST_TUPLE_PART_ID: |
| setAstTuplePartId(AST_TUPLE_PART_ID_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CGModelPackage.CG_TUPLE_PART_CALL_EXP__AST_TUPLE_PART_ID: |
| return AST_TUPLE_PART_ID_EDEFAULT == null ? astTuplePartId != null : !AST_TUPLE_PART_ID_EDEFAULT.equals(astTuplePartId); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public <R> R accept(@NonNull CGModelVisitor<R> visitor) { |
| return visitor.visitCGTuplePartCallExp(this); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isBoxed() { |
| return true; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isEcore() { |
| return false; |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isNonInvalid() { |
| CGValuedElement source = getSource(); |
| return source.isNonNull() && source.isNonInvalid(); |
| } |
| |
| /** |
| * {@inheritDoc} |
| * @generated |
| */ |
| @Override |
| public boolean isUnboxed() { |
| return false; |
| } |
| |
| } //CGTuplePartCallExpImpl |