/** * <copyright> * </copyright> * * $Id$ */ package net.sf.etl.samples.ej.ast.impl; import java.util.Collection; import net.sf.etl.samples.ej.ast.AstPackage; import net.sf.etl.samples.ej.ast.AttributeSet; import net.sf.etl.samples.ej.ast.Expression; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Attribute Set</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link net.sf.etl.samples.ej.ast.impl.AttributeSetImpl#getAttributes <em>Attributes</em>}</li> * </ul> * </p> * * @generated */ public class AttributeSetImpl extends EJElementImpl implements AttributeSet { /** * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAttributes() * @generated * @ordered */ protected EList attributes = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AttributeSetImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return AstPackage.Literals.ATTRIBUTE_SET; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList getAttributes() { if (attributes == null) { attributes = new EObjectContainmentEList(Expression.class, this, AstPackage.ATTRIBUTE_SET__ATTRIBUTES); } return attributes; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case AstPackage.ATTRIBUTE_SET__ATTRIBUTES: return ((InternalEList)getAttributes()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AstPackage.ATTRIBUTE_SET__ATTRIBUTES: return getAttributes(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case AstPackage.ATTRIBUTE_SET__ATTRIBUTES: getAttributes().clear(); getAttributes().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case AstPackage.ATTRIBUTE_SET__ATTRIBUTES: getAttributes().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case AstPackage.ATTRIBUTE_SET__ATTRIBUTES: return attributes != null && !attributes.isEmpty(); } return super.eIsSet(featureID); } } //AttributeSetImpl