/** */ package at.bestsolution.efxclipse.tooling.css.cssDsl.impl; import at.bestsolution.efxclipse.tooling.css.cssDsl.CssDslPackage; import at.bestsolution.efxclipse.tooling.css.cssDsl.css_declaration; import at.bestsolution.efxclipse.tooling.css.cssDsl.ruleset; import at.bestsolution.efxclipse.tooling.css.cssDsl.selector; import java.util.Collection; 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.impl.MinimalEObjectImpl; 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>ruleset</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.rulesetImpl#getSelectors <em>Selectors</em>}</li> * <li>{@link at.bestsolution.efxclipse.tooling.css.cssDsl.impl.rulesetImpl#getDeclarations <em>Declarations</em>}</li> * </ul> * </p> * * @generated */ public class rulesetImpl extends MinimalEObjectImpl.Container implements ruleset { /** * The cached value of the '{@link #getSelectors() <em>Selectors</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSelectors() * @generated * @ordered */ protected EList<selector> selectors; /** * The cached value of the '{@link #getDeclarations() <em>Declarations</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDeclarations() * @generated * @ordered */ protected EList<css_declaration> declarations; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected rulesetImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CssDslPackage.Literals.RULESET; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<selector> getSelectors() { if (selectors == null) { selectors = new EObjectContainmentEList<selector>(selector.class, this, CssDslPackage.RULESET__SELECTORS); } return selectors; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<css_declaration> getDeclarations() { if (declarations == null) { declarations = new EObjectContainmentEList<css_declaration>(css_declaration.class, this, CssDslPackage.RULESET__DECLARATIONS); } return declarations; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CssDslPackage.RULESET__SELECTORS: return ((InternalEList<?>)getSelectors()).basicRemove(otherEnd, msgs); case CssDslPackage.RULESET__DECLARATIONS: return ((InternalEList<?>)getDeclarations()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CssDslPackage.RULESET__SELECTORS: return getSelectors(); case CssDslPackage.RULESET__DECLARATIONS: return getDeclarations(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CssDslPackage.RULESET__SELECTORS: getSelectors().clear(); getSelectors().addAll((Collection<? extends selector>)newValue); return; case CssDslPackage.RULESET__DECLARATIONS: getDeclarations().clear(); getDeclarations().addAll((Collection<? extends css_declaration>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CssDslPackage.RULESET__SELECTORS: getSelectors().clear(); return; case CssDslPackage.RULESET__DECLARATIONS: getDeclarations().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CssDslPackage.RULESET__SELECTORS: return selectors != null && !selectors.isEmpty(); case CssDslPackage.RULESET__DECLARATIONS: return declarations != null && !declarations.isEmpty(); } return super.eIsSet(featureID); } } //rulesetImpl