/** */ package de.hub.emfcompress.emffrag.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.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import de.hub.emfcompress.Trash; import de.hub.emfcompress.emffrag.meta.EmfCompressPackage; import de.hub.emffrag.FObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Trash</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link de.hub.emfcompress.emffrag.impl.TrashImpl#getContents <em>Contents</em>}</li> * </ul> * * @generated */ public class TrashImpl extends FObjectImpl implements Trash { /** * The cached value of the '{@link #getContents() <em>Contents</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContents() * @generated * @ordered */ protected EList<EObject> contents; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TrashImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return EmfCompressPackage.Literals.TRASH; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<EObject> getContents() { if (contents == null) { contents = new EObjectContainmentEList<EObject>(EObject.class, this, EmfCompressPackage.TRASH__CONTENTS); } return contents; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case EmfCompressPackage.TRASH__CONTENTS: return ((InternalEList<?>)getContents()).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 EmfCompressPackage.TRASH__CONTENTS: return getContents(); } 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 EmfCompressPackage.TRASH__CONTENTS: getContents().clear(); getContents().addAll((Collection<? extends EObject>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EmfCompressPackage.TRASH__CONTENTS: getContents().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EmfCompressPackage.TRASH__CONTENTS: return contents != null && !contents.isEmpty(); } return super.eIsSet(featureID); } } //TrashImpl