org.eclipse.xtext.impl.CharacterRangeImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: CharacterRangeImpl.java,v 1.3 2010/04/06 14:09:52 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.CharacterRange;
import org.eclipse.xtext.Keyword;
import org.eclipse.xtext.XtextPackage;
/**
*
* An implementation of the model object 'Character Range'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.xtext.impl.CharacterRangeImpl#getLeft Left}
* - {@link org.eclipse.xtext.impl.CharacterRangeImpl#getRight Right}
*
*
*
* @generated
*/
public class CharacterRangeImpl extends AbstractElementImpl implements CharacterRange {
/**
* The cached value of the '{@link #getLeft() Left}' containment reference.
*
*
* @see #getLeft()
* @generated
* @ordered
*/
protected Keyword left;
/**
* The cached value of the '{@link #getRight() Right}' containment reference.
*
*
* @see #getRight()
* @generated
* @ordered
*/
protected Keyword right;
/**
*
*
* @generated
*/
protected CharacterRangeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return XtextPackage.Literals.CHARACTER_RANGE;
}
/**
*
*
* @generated
*/
public Keyword getLeft() {
return left;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetLeft(Keyword newLeft, NotificationChain msgs) {
Keyword oldLeft = left;
left = newLeft;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.CHARACTER_RANGE__LEFT, oldLeft, newLeft);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setLeft(Keyword newLeft) {
if (newLeft != left) {
NotificationChain msgs = null;
if (left != null)
msgs = ((InternalEObject)left).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__LEFT, null, msgs);
if (newLeft != null)
msgs = ((InternalEObject)newLeft).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__LEFT, null, msgs);
msgs = basicSetLeft(newLeft, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.CHARACTER_RANGE__LEFT, newLeft, newLeft));
}
/**
*
*
* @generated
*/
public Keyword getRight() {
return right;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetRight(Keyword newRight, NotificationChain msgs) {
Keyword oldRight = right;
right = newRight;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XtextPackage.CHARACTER_RANGE__RIGHT, oldRight, newRight);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setRight(Keyword newRight) {
if (newRight != right) {
NotificationChain msgs = null;
if (right != null)
msgs = ((InternalEObject)right).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__RIGHT, null, msgs);
if (newRight != null)
msgs = ((InternalEObject)newRight).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XtextPackage.CHARACTER_RANGE__RIGHT, null, msgs);
msgs = basicSetRight(newRight, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, XtextPackage.CHARACTER_RANGE__RIGHT, newRight, newRight));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case XtextPackage.CHARACTER_RANGE__LEFT:
return basicSetLeft(null, msgs);
case XtextPackage.CHARACTER_RANGE__RIGHT:
return basicSetRight(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case XtextPackage.CHARACTER_RANGE__LEFT:
return getLeft();
case XtextPackage.CHARACTER_RANGE__RIGHT:
return getRight();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case XtextPackage.CHARACTER_RANGE__LEFT:
setLeft((Keyword)newValue);
return;
case XtextPackage.CHARACTER_RANGE__RIGHT:
setRight((Keyword)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case XtextPackage.CHARACTER_RANGE__LEFT:
setLeft((Keyword)null);
return;
case XtextPackage.CHARACTER_RANGE__RIGHT:
setRight((Keyword)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case XtextPackage.CHARACTER_RANGE__LEFT:
return left != null;
case XtextPackage.CHARACTER_RANGE__RIGHT:
return right != null;
}
return super.eIsSet(featureID);
}
} //CharacterRangeImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy