blob: 227c2b70bb4ec2151157b09824c89818383a6543 [file] [log] [blame]
/**
* * 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.vpm.editmodel.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.viatra2.gtasmmodel.gtasm.metamodel.asm.core.impl.AnnotatedElementImpl;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.VariableReference;
import org.eclipse.viatra2.gtasmmodel.vpm.editmodel.EditmodelPackage;
import org.eclipse.viatra2.gtasmmodel.vpm.editmodel.VPMElement;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>VPM Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.viatra2.gtasmmodel.vpm.editmodel.impl.VPMElementImpl#getVariableReferences <em>Variable References</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class VPMElementImpl extends AnnotatedElementImpl implements VPMElement
{
/**
* <!-- 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 #getVariableReferences() <em>Variable References</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVariableReferences()
* @generated
* @ordered
*/
protected EList<VariableReference> variableReferences;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected VPMElementImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return EditmodelPackage.Literals.VPM_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<VariableReference> getVariableReferences()
{
if (variableReferences == null)
{
variableReferences = new EObjectContainmentEList<VariableReference>(VariableReference.class, this, EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES);
}
return variableReferences;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES:
return ((InternalEList<?>)getVariableReferences()).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 EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES:
return getVariableReferences();
}
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 EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES:
getVariableReferences().clear();
getVariableReferences().addAll((Collection<? extends VariableReference>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES:
getVariableReferences().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case EditmodelPackage.VPM_ELEMENT__VARIABLE_REFERENCES:
return variableReferences != null && !variableReferences.isEmpty();
}
return super.eIsSet(featureID);
}
} //VPMElementImpl