org.eclipse.xtext.impl.AbstractNegatedTokenImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: AbstractNegatedTokenImpl.java,v 1.3 2010/04/06 14:09:51 sefftinge Exp $
*/
package org.eclipse.xtext.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.xtext.AbstractElement;
import org.eclipse.xtext.AbstractNegatedToken;
import org.eclipse.xtext.XtextPackage;
/**
*
* An implementation of the model object 'Abstract Negated Token'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.impl.AbstractNegatedTokenImpl#getTerminal Terminal}
*
*
*
* @generated
*/
public class AbstractNegatedTokenImpl extends AbstractElementImpl implements AbstractNegatedToken {
/**
* The cached value of the '{@link #getTerminal() Terminal}' containment reference.
*
*
* @see #getTerminal()
* @generated
* @ordered
*/
protected AbstractElement terminal;
/**
*
*
* @generated
*/
protected AbstractNegatedTokenImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.ABSTRACT_NEGATED_TOKEN;
}
/**
*
*
* @generated
*/
public AbstractElement getTerminal() {
return terminal;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTerminal(AbstractElement newTerminal, NotificationChain msgs) {
AbstractElement oldTerminal = terminal;
terminal = newTerminal;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL, oldTerminal, newTerminal);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTerminal(AbstractElement newTerminal) {
if (newTerminal != terminal) {
NotificationChain msgs = null;
if (terminal != null)
msgs = ((InternalEObject)terminal).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL, null, msgs);
if (newTerminal != null)
msgs = ((InternalEObject)newTerminal).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL, null, msgs);
msgs = basicSetTerminal(newTerminal, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL, newTerminal, newTerminal));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL:
return basicSetTerminal(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL:
return getTerminal();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL:
setTerminal((AbstractElement)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL:
setTerminal((AbstractElement)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.ABSTRACT_NEGATED_TOKEN__TERMINAL:
return terminal != null;
}
return super.eIsSet(featureID);
}
} //AbstractNegatedTokenImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy