
org.integratedmodelling.kim.kim.impl.AnnotationImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.9.2
*/
package org.integratedmodelling.kim.kim.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.emf.ecore.impl.MinimalEObjectImpl;
import org.integratedmodelling.kim.kim.Annotation;
import org.integratedmodelling.kim.kim.KimPackage;
import org.integratedmodelling.kim.kim.ParameterList;
/**
*
* An implementation of the model object 'Annotation'.
*
*
* The following features are implemented:
*
*
* - {@link org.integratedmodelling.kim.kim.impl.AnnotationImpl#getId Id}
* - {@link org.integratedmodelling.kim.kim.impl.AnnotationImpl#getParameters Parameters}
*
*
* @generated
*/
public class AnnotationImpl extends MinimalEObjectImpl.Container implements Annotation
{
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The cached value of the '{@link #getParameters() Parameters}' containment reference.
*
*
* @see #getParameters()
* @generated
* @ordered
*/
protected ParameterList parameters;
/**
*
*
* @generated
*/
protected AnnotationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return KimPackage.Literals.ANNOTATION;
}
/**
*
*
* @generated
*/
public String getId()
{
return id;
}
/**
*
*
* @generated
*/
public void setId(String newId)
{
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KimPackage.ANNOTATION__ID, oldId, id));
}
/**
*
*
* @generated
*/
public ParameterList getParameters()
{
return parameters;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetParameters(ParameterList newParameters, NotificationChain msgs)
{
ParameterList oldParameters = parameters;
parameters = newParameters;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, KimPackage.ANNOTATION__PARAMETERS, oldParameters, newParameters);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setParameters(ParameterList newParameters)
{
if (newParameters != parameters)
{
NotificationChain msgs = null;
if (parameters != null)
msgs = ((InternalEObject)parameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - KimPackage.ANNOTATION__PARAMETERS, null, msgs);
if (newParameters != null)
msgs = ((InternalEObject)newParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - KimPackage.ANNOTATION__PARAMETERS, null, msgs);
msgs = basicSetParameters(newParameters, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, KimPackage.ANNOTATION__PARAMETERS, newParameters, newParameters));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case KimPackage.ANNOTATION__PARAMETERS:
return basicSetParameters(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case KimPackage.ANNOTATION__ID:
return getId();
case KimPackage.ANNOTATION__PARAMETERS:
return getParameters();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case KimPackage.ANNOTATION__ID:
setId((String)newValue);
return;
case KimPackage.ANNOTATION__PARAMETERS:
setParameters((ParameterList)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case KimPackage.ANNOTATION__ID:
setId(ID_EDEFAULT);
return;
case KimPackage.ANNOTATION__PARAMETERS:
setParameters((ParameterList)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case KimPackage.ANNOTATION__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case KimPackage.ANNOTATION__PARAMETERS:
return parameters != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: ");
result.append(id);
result.append(')');
return result.toString();
}
} //AnnotationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy