/** */ package org.eclipse.gmf.tooling.examples.pins.impl; 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.EObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.gmf.tooling.examples.pins.Diagram; import org.eclipse.gmf.tooling.examples.pins.Pin; import org.eclipse.gmf.tooling.examples.pins.PinsPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Diagram</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.gmf.tooling.examples.pins.impl.DiagramImpl#getGetPins <em>Get Pins</em>}</li> * </ul> * </p> * * @generated */ public class DiagramImpl extends EObjectImpl implements Diagram { /** * The cached value of the '{@link #getGetPins() <em>Get Pins</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGetPins() * @generated * @ordered */ protected EList<Pin> getPins; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DiagramImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return PinsPackage.Literals.DIAGRAM; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Pin> getGetPins() { if (getPins == null) { getPins = new EObjectContainmentEList<Pin>(Pin.class, this, PinsPackage.DIAGRAM__GET_PINS); } return getPins; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case PinsPackage.DIAGRAM__GET_PINS: return ((InternalEList<?>)getGetPins()).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 PinsPackage.DIAGRAM__GET_PINS: return getGetPins(); } 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 PinsPackage.DIAGRAM__GET_PINS: getGetPins().clear(); getGetPins().addAll((Collection<? extends Pin>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case PinsPackage.DIAGRAM__GET_PINS: getGetPins().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case PinsPackage.DIAGRAM__GET_PINS: return getPins != null && !getPins.isEmpty(); } return super.eIsSet(featureID); } } //DiagramImpl