/**
*/
package de.ugoe.cs.swe.bnftools.ebnf.impl;
import de.ugoe.cs.swe.bnftools.ebnf.Atom;
import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
import de.ugoe.cs.swe.bnftools.ebnf.GroupedSequence;
import de.ugoe.cs.swe.bnftools.ebnf.OptionalSequence;
import de.ugoe.cs.swe.bnftools.ebnf.RepeatedSequence;
import de.ugoe.cs.swe.bnftools.ebnf.Term;
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;
/**
*
* An implementation of the model object 'Term'.
*
*
* The following features are implemented:
*
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermAtom Term Atom}
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermGroupedSequence Term Grouped Sequence}
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermOptionalSequence Term Optional Sequence}
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.TermImpl#getTermRepeatedSequence Term Repeated Sequence}
*
*
*
* @generated
*/
public class TermImpl extends MinimalEObjectImpl.Container implements Term
{
/**
* The cached value of the '{@link #getTermAtom() Term Atom}' containment reference.
*
*
* @see #getTermAtom()
* @generated
* @ordered
*/
protected Atom termAtom;
/**
* The cached value of the '{@link #getTermGroupedSequence() Term Grouped Sequence}' containment reference.
*
*
* @see #getTermGroupedSequence()
* @generated
* @ordered
*/
protected GroupedSequence termGroupedSequence;
/**
* The cached value of the '{@link #getTermOptionalSequence() Term Optional Sequence}' containment reference.
*
*
* @see #getTermOptionalSequence()
* @generated
* @ordered
*/
protected OptionalSequence termOptionalSequence;
/**
* The cached value of the '{@link #getTermRepeatedSequence() Term Repeated Sequence}' containment reference.
*
*
* @see #getTermRepeatedSequence()
* @generated
* @ordered
*/
protected RepeatedSequence termRepeatedSequence;
/**
*
*
* @generated
*/
protected TermImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return EbnfPackage.Literals.TERM;
}
/**
*
*
* @generated
*/
public Atom getTermAtom()
{
return termAtom;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTermAtom(Atom newTermAtom, NotificationChain msgs)
{
Atom oldTermAtom = termAtom;
termAtom = newTermAtom;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_ATOM, oldTermAtom, newTermAtom);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTermAtom(Atom newTermAtom)
{
if (newTermAtom != termAtom)
{
NotificationChain msgs = null;
if (termAtom != null)
msgs = ((InternalEObject)termAtom).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_ATOM, null, msgs);
if (newTermAtom != null)
msgs = ((InternalEObject)newTermAtom).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_ATOM, null, msgs);
msgs = basicSetTermAtom(newTermAtom, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_ATOM, newTermAtom, newTermAtom));
}
/**
*
*
* @generated
*/
public GroupedSequence getTermGroupedSequence()
{
return termGroupedSequence;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTermGroupedSequence(GroupedSequence newTermGroupedSequence, NotificationChain msgs)
{
GroupedSequence oldTermGroupedSequence = termGroupedSequence;
termGroupedSequence = newTermGroupedSequence;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, oldTermGroupedSequence, newTermGroupedSequence);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTermGroupedSequence(GroupedSequence newTermGroupedSequence)
{
if (newTermGroupedSequence != termGroupedSequence)
{
NotificationChain msgs = null;
if (termGroupedSequence != null)
msgs = ((InternalEObject)termGroupedSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, null, msgs);
if (newTermGroupedSequence != null)
msgs = ((InternalEObject)newTermGroupedSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, null, msgs);
msgs = basicSetTermGroupedSequence(newTermGroupedSequence, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_GROUPED_SEQUENCE, newTermGroupedSequence, newTermGroupedSequence));
}
/**
*
*
* @generated
*/
public OptionalSequence getTermOptionalSequence()
{
return termOptionalSequence;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTermOptionalSequence(OptionalSequence newTermOptionalSequence, NotificationChain msgs)
{
OptionalSequence oldTermOptionalSequence = termOptionalSequence;
termOptionalSequence = newTermOptionalSequence;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, oldTermOptionalSequence, newTermOptionalSequence);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTermOptionalSequence(OptionalSequence newTermOptionalSequence)
{
if (newTermOptionalSequence != termOptionalSequence)
{
NotificationChain msgs = null;
if (termOptionalSequence != null)
msgs = ((InternalEObject)termOptionalSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, null, msgs);
if (newTermOptionalSequence != null)
msgs = ((InternalEObject)newTermOptionalSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, null, msgs);
msgs = basicSetTermOptionalSequence(newTermOptionalSequence, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE, newTermOptionalSequence, newTermOptionalSequence));
}
/**
*
*
* @generated
*/
public RepeatedSequence getTermRepeatedSequence()
{
return termRepeatedSequence;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetTermRepeatedSequence(RepeatedSequence newTermRepeatedSequence, NotificationChain msgs)
{
RepeatedSequence oldTermRepeatedSequence = termRepeatedSequence;
termRepeatedSequence = newTermRepeatedSequence;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, oldTermRepeatedSequence, newTermRepeatedSequence);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setTermRepeatedSequence(RepeatedSequence newTermRepeatedSequence)
{
if (newTermRepeatedSequence != termRepeatedSequence)
{
NotificationChain msgs = null;
if (termRepeatedSequence != null)
msgs = ((InternalEObject)termRepeatedSequence).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, null, msgs);
if (newTermRepeatedSequence != null)
msgs = ((InternalEObject)newTermRepeatedSequence).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, null, msgs);
msgs = basicSetTermRepeatedSequence(newTermRepeatedSequence, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.TERM__TERM_REPEATED_SEQUENCE, newTermRepeatedSequence, newTermRepeatedSequence));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case EbnfPackage.TERM__TERM_ATOM:
return basicSetTermAtom(null, msgs);
case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
return basicSetTermGroupedSequence(null, msgs);
case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
return basicSetTermOptionalSequence(null, msgs);
case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
return basicSetTermRepeatedSequence(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case EbnfPackage.TERM__TERM_ATOM:
return getTermAtom();
case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
return getTermGroupedSequence();
case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
return getTermOptionalSequence();
case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
return getTermRepeatedSequence();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case EbnfPackage.TERM__TERM_ATOM:
setTermAtom((Atom)newValue);
return;
case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
setTermGroupedSequence((GroupedSequence)newValue);
return;
case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
setTermOptionalSequence((OptionalSequence)newValue);
return;
case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
setTermRepeatedSequence((RepeatedSequence)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case EbnfPackage.TERM__TERM_ATOM:
setTermAtom((Atom)null);
return;
case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
setTermGroupedSequence((GroupedSequence)null);
return;
case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
setTermOptionalSequence((OptionalSequence)null);
return;
case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
setTermRepeatedSequence((RepeatedSequence)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case EbnfPackage.TERM__TERM_ATOM:
return termAtom != null;
case EbnfPackage.TERM__TERM_GROUPED_SEQUENCE:
return termGroupedSequence != null;
case EbnfPackage.TERM__TERM_OPTIONAL_SEQUENCE:
return termOptionalSequence != null;
case EbnfPackage.TERM__TERM_REPEATED_SEQUENCE:
return termRepeatedSequence != null;
}
return super.eIsSet(featureID);
}
} //TermImpl