blob: 956da3999d69232edb3e247081bcd7cf79cefdc1 [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz - Initial implementation
*
*/
package org.eclipse.osbp.xtext.functionlibrarydsl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryDSLPackage;
import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryFunction;
import org.eclipse.xtext.common.types.JvmParameterizedTypeReference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Function Library Function</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.functionlibrarydsl.impl.FunctionLibraryFunctionImpl#getOftype <em>Oftype</em>}</li>
* </ul>
*
* @generated
*/
public class FunctionLibraryFunctionImpl extends FunctionLibraryBaseFunctionImpl implements FunctionLibraryFunction {
/**
* The cached value of the '{@link #getOftype() <em>Oftype</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOftype()
* @generated
* @ordered
*/
protected JvmParameterizedTypeReference oftype;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FunctionLibraryFunctionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FunctionLibraryDSLPackage.Literals.FUNCTION_LIBRARY_FUNCTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JvmParameterizedTypeReference getOftype() {
return oftype;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOftype(JvmParameterizedTypeReference newOftype, NotificationChain msgs) {
JvmParameterizedTypeReference oldOftype = oftype;
oftype = newOftype;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE, oldOftype, newOftype);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOftype(JvmParameterizedTypeReference newOftype) {
if (newOftype != oftype) {
NotificationChain msgs = null;
if (oftype != null)
msgs = ((InternalEObject)oftype).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE, null, msgs);
if (newOftype != null)
msgs = ((InternalEObject)newOftype).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE, null, msgs);
msgs = basicSetOftype(newOftype, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE, newOftype, newOftype));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE:
return basicSetOftype(null, 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 FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE:
return getOftype();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE:
setOftype((JvmParameterizedTypeReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE:
setOftype((JvmParameterizedTypeReference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FunctionLibraryDSLPackage.FUNCTION_LIBRARY_FUNCTION__OFTYPE:
return oftype != null;
}
return super.eIsSet(featureID);
}
} //FunctionLibraryFunctionImpl