/** * Copyright (c) 2011 Obeo. * 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 * * Contributors: * Obeo - initial API and implementation */ package org.obeonetwork.dsl.database.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.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; import org.obeonetwork.dsl.database.AbstractTable; import org.obeonetwork.dsl.database.DatabasePackage; import org.obeonetwork.dsl.database.Sequence; import org.obeonetwork.dsl.database.TableContainer; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Table Container</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.obeonetwork.dsl.database.impl.TableContainerImpl#getTables <em>Tables</em>}</li> * <li>{@link org.obeonetwork.dsl.database.impl.TableContainerImpl#getSequences <em>Sequences</em>}</li> * </ul> * </p> * * @generated */ public abstract class TableContainerImpl extends NamedElementImpl implements TableContainer { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final String copyright = "Copyright (c) 2011 Obeo.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Obeo - initial API and implementation"; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected TableContainerImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DatabasePackage.Literals.TABLE_CONTAINER; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") public EList<AbstractTable> getTables() { return (EList<AbstractTable>)eDynamicGet(DatabasePackage.TABLE_CONTAINER__TABLES, DatabasePackage.Literals.TABLE_CONTAINER__TABLES, true, true); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") public EList<Sequence> getSequences() { return (EList<Sequence>)eDynamicGet(DatabasePackage.TABLE_CONTAINER__SEQUENCES, DatabasePackage.Literals.TABLE_CONTAINER__SEQUENCES, true, true); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DatabasePackage.TABLE_CONTAINER__TABLES: return ((InternalEList<InternalEObject>)(InternalEList<?>)getTables()).basicAdd(otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DatabasePackage.TABLE_CONTAINER__TABLES: return ((InternalEList<?>)getTables()).basicRemove(otherEnd, msgs); case DatabasePackage.TABLE_CONTAINER__SEQUENCES: return ((InternalEList<?>)getSequences()).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 DatabasePackage.TABLE_CONTAINER__TABLES: return getTables(); case DatabasePackage.TABLE_CONTAINER__SEQUENCES: return getSequences(); } 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 DatabasePackage.TABLE_CONTAINER__TABLES: getTables().clear(); getTables().addAll((Collection<? extends AbstractTable>)newValue); return; case DatabasePackage.TABLE_CONTAINER__SEQUENCES: getSequences().clear(); getSequences().addAll((Collection<? extends Sequence>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DatabasePackage.TABLE_CONTAINER__TABLES: getTables().clear(); return; case DatabasePackage.TABLE_CONTAINER__SEQUENCES: getSequences().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public boolean eIsSet(int featureID) { switch (featureID) { case DatabasePackage.TABLE_CONTAINER__TABLES: return !getTables().isEmpty(); case DatabasePackage.TABLE_CONTAINER__SEQUENCES: return !getSequences().isEmpty(); } return super.eIsSet(featureID); } } //TableContainerImpl