blob: cbc1094d7fd367051f7ee1eda600d4b39bc580f6 [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.gtasm.metamodel.asm.terms.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.ASMFunction;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.ASMFunctionInvocation;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.TermsPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ASM Function Invocation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.impl.ASMFunctionInvocationImpl#getCalledFunction <em>Called Function</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ASMFunctionInvocationImpl extends FunctionInvocationImpl implements ASMFunctionInvocation
{
/**
* <!-- 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 #getCalledFunction() <em>Called Function</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCalledFunction()
* @generated
* @ordered
*/
protected ASMFunction calledFunction;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ASMFunctionInvocationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TermsPackage.Literals.ASM_FUNCTION_INVOCATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ASMFunction getCalledFunction()
{
if (calledFunction != null && calledFunction.eIsProxy())
{
InternalEObject oldCalledFunction = (InternalEObject)calledFunction;
calledFunction = (ASMFunction)eResolveProxy(oldCalledFunction);
if (calledFunction != oldCalledFunction)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION, oldCalledFunction, calledFunction));
}
}
return calledFunction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ASMFunction basicGetCalledFunction()
{
return calledFunction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCalledFunction(ASMFunction newCalledFunction)
{
ASMFunction oldCalledFunction = calledFunction;
calledFunction = newCalledFunction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION, oldCalledFunction, calledFunction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION:
if (resolve) return getCalledFunction();
return basicGetCalledFunction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION:
setCalledFunction((ASMFunction)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION:
setCalledFunction((ASMFunction)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TermsPackage.ASM_FUNCTION_INVOCATION__CALLED_FUNCTION:
return calledFunction != null;
}
return super.eIsSet(featureID);
}
} //ASMFunctionInvocationImpl