/******************************************************************************* * Copyright (c) 2010 Martin Schnabel <mb0@mb0.org>. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.axdt.as3.model.impl; import java.util.Collection; import org.axdt.as3.As3EPackage; import org.axdt.as3.model.As3Block; import org.axdt.as3.model.IDirective; 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>As3 Block</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.axdt.as3.model.impl.As3BlockImpl#getDirectives <em>Directives</em>}</li> * </ul> * </p> * * @generated */ public class As3BlockImpl extends MinimalEObjectImpl.Container implements As3Block { /** * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected int flags = 0; /** * The cached value of the '{@link #getDirectives() <em>Directives</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDirectives() * @generated * @ordered */ protected EList<IDirective> directives; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected As3BlockImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return As3EPackage.Literals.AS3_BLOCK; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<IDirective> getDirectives() { if (directives == null) { directives = new EObjectContainmentEList<IDirective>(IDirective.class, this, As3EPackage.AS3_BLOCK__DIRECTIVES); } return directives; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case As3EPackage.AS3_BLOCK__DIRECTIVES: return ((InternalEList<?>)getDirectives()).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 As3EPackage.AS3_BLOCK__DIRECTIVES: return getDirectives(); } 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 As3EPackage.AS3_BLOCK__DIRECTIVES: getDirectives().clear(); getDirectives().addAll((Collection<? extends IDirective>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case As3EPackage.AS3_BLOCK__DIRECTIVES: getDirectives().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case As3EPackage.AS3_BLOCK__DIRECTIVES: return directives != null && !directives.isEmpty(); } return super.eIsSet(featureID); } } //As3BlockImpl