blob: e54e32730164d4c9f8ecd92990d8e2db2abee684 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2019 EclipseSource Muenchen GmbH and others.
*
* 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:
* Eugen Neufeld - initial API and implementation
* Christian W. Damus - bug 543190
*******************************************************************************/
package org.eclipse.emf.ecp.view.validation.test.model.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.InternalEList;
import org.eclipse.emf.ecp.view.validation.test.model.TableContent;
import org.eclipse.emf.ecp.view.validation.test.model.TableWithoutMultiplicity;
import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Table Without Multiplicity</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.TableWithoutMultiplicityImpl#getContent
* <em>Content</em>}</li>
* </ul>
*
* @generated
*/
public class TableWithoutMultiplicityImpl extends TableObjectImpl implements TableWithoutMultiplicity {
/**
* The cached value of the '{@link #getContent() <em>Content</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getContent()
* @generated
* @ordered
*/
protected EList<TableContent> content;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected TableWithoutMultiplicityImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return TestPackage.Literals.TABLE_WITHOUT_MULTIPLICITY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<TableContent> getContent() {
if (content == null) {
content = new EObjectContainmentEList<>(TableContent.class, this,
TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT);
}
return content;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT:
return ((InternalEList<?>) getContent()).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 TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT:
return getContent();
}
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 TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT:
getContent().clear();
getContent().addAll((Collection<? extends TableContent>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT:
getContent().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TestPackage.TABLE_WITHOUT_MULTIPLICITY__CONTENT:
return content != null && !content.isEmpty();
}
return super.eIsSet(featureID);
}
} // TableWithoutMultiplicityImpl