/**
*/
package de.ugoe.cs.swe.bnftools.ebnf.impl;
import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
import de.ugoe.cs.swe.bnftools.ebnf.HookCombinator;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
/**
*
* An implementation of the model object 'Hook Combinator'.
*
*
* The following features are implemented:
*
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.HookCombinatorImpl#getName Name}
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.HookCombinatorImpl#getRuleext Ruleext}
* - {@link de.ugoe.cs.swe.bnftools.ebnf.impl.HookCombinatorImpl#getLABEL LABEL}
*
*
*
* @generated
*/
public class HookCombinatorImpl extends MergeRuleImpl implements HookCombinator
{
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getRuleext() Ruleext}' attribute.
*
*
* @see #getRuleext()
* @generated
* @ordered
*/
protected static final int RULEEXT_EDEFAULT = 0;
/**
* The cached value of the '{@link #getRuleext() Ruleext}' attribute.
*
*
* @see #getRuleext()
* @generated
* @ordered
*/
protected int ruleext = RULEEXT_EDEFAULT;
/**
* The cached value of the '{@link #getLABEL() LABEL}' attribute list.
*
*
* @see #getLABEL()
* @generated
* @ordered
*/
protected EList label;
/**
*
*
* @generated
*/
protected HookCombinatorImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return EbnfPackage.Literals.HOOK_COMBINATOR;
}
/**
*
*
* @generated
*/
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.HOOK_COMBINATOR__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public int getRuleext()
{
return ruleext;
}
/**
*
*
* @generated
*/
public void setRuleext(int newRuleext)
{
int oldRuleext = ruleext;
ruleext = newRuleext;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.HOOK_COMBINATOR__RULEEXT, oldRuleext, ruleext));
}
/**
*
*
* @generated
*/
public EList getLABEL()
{
if (label == null)
{
label = new EDataTypeEList(String.class, this, EbnfPackage.HOOK_COMBINATOR__LABEL);
}
return label;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case EbnfPackage.HOOK_COMBINATOR__NAME:
return getName();
case EbnfPackage.HOOK_COMBINATOR__RULEEXT:
return getRuleext();
case EbnfPackage.HOOK_COMBINATOR__LABEL:
return getLABEL();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case EbnfPackage.HOOK_COMBINATOR__NAME:
setName((String)newValue);
return;
case EbnfPackage.HOOK_COMBINATOR__RULEEXT:
setRuleext((Integer)newValue);
return;
case EbnfPackage.HOOK_COMBINATOR__LABEL:
getLABEL().clear();
getLABEL().addAll((Collection extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case EbnfPackage.HOOK_COMBINATOR__NAME:
setName(NAME_EDEFAULT);
return;
case EbnfPackage.HOOK_COMBINATOR__RULEEXT:
setRuleext(RULEEXT_EDEFAULT);
return;
case EbnfPackage.HOOK_COMBINATOR__LABEL:
getLABEL().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case EbnfPackage.HOOK_COMBINATOR__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case EbnfPackage.HOOK_COMBINATOR__RULEEXT:
return ruleext != RULEEXT_EDEFAULT;
case EbnfPackage.HOOK_COMBINATOR__LABEL:
return label != null && !label.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", ruleext: ");
result.append(ruleext);
result.append(", LABEL: ");
result.append(label);
result.append(')');
return result.toString();
}
} //HookCombinatorImpl