| /** |
| * * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro |
| * * 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: |
| * * Istvan Rath, Daniel Varro - initial API and implementation |
| * |
| */ |
| package org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.gt.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.impl.VariableImpl; |
| |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.gt.GtPackage; |
| import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.gt.PatternVariable; |
| |
| import org.eclipse.viatra2.gtasmmodel.vpm.editmodel.ModelElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Pattern Variable</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.gt.impl.PatternVariableImpl#getElementInPattern <em>Element In Pattern</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PatternVariableImpl extends VariableImpl implements PatternVariable |
| { |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final String copyright = " * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors:\r\n * Istvan Rath, Daniel Varro - initial API and implementation\r\n"; |
| |
| /** |
| * The cached value of the '{@link #getElementInPattern() <em>Element In Pattern</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElementInPattern() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ModelElement> elementInPattern; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PatternVariableImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return GtPackage.Literals.PATTERN_VARIABLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ModelElement> getElementInPattern() |
| { |
| if (elementInPattern == null) |
| { |
| elementInPattern = new EObjectResolvingEList<ModelElement>(ModelElement.class, this, GtPackage.PATTERN_VARIABLE__ELEMENT_IN_PATTERN); |
| } |
| return elementInPattern; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case GtPackage.PATTERN_VARIABLE__ELEMENT_IN_PATTERN: |
| return getElementInPattern(); |
| } |
| 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 GtPackage.PATTERN_VARIABLE__ELEMENT_IN_PATTERN: |
| getElementInPattern().clear(); |
| getElementInPattern().addAll((Collection<? extends ModelElement>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case GtPackage.PATTERN_VARIABLE__ELEMENT_IN_PATTERN: |
| getElementInPattern().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case GtPackage.PATTERN_VARIABLE__ELEMENT_IN_PATTERN: |
| return elementInPattern != null && !elementInPattern.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //PatternVariableImpl |