blob: dbb2727f43e02d9b2f5c5a03cdb4ebb598194771 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2014 itemis 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:
* itemis - Initial API and implementation
*
* </copyright>
*/
package org.eclipse.sphinx.tests.emf.serialization.model.extnodes.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.sphinx.tests.emf.serialization.model.extnodes.ExtNodesPackage;
import org.eclipse.sphinx.tests.emf.serialization.model.extnodes.ExtendedNode;
import org.eclipse.sphinx.tests.emf.serialization.model.extnodes.Extension;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Extension</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.sphinx.tests.emf.serialization.model.extnodes.impl.ExtensionImpl#getExtensions <em>Extensions</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ExtensionImpl extends EObjectImpl implements Extension {
/**
* The cached value of the '{@link #getExtensions() <em>Extensions</em>}' containment reference list. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getExtensions()
* @generated
* @ordered
*/
protected EList<ExtendedNode> extensions;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected ExtensionImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExtNodesPackage.Literals.EXTENSION;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<ExtendedNode> getExtensions() {
if (extensions == null) {
extensions = new EObjectContainmentEList<ExtendedNode>(ExtendedNode.class, this, ExtNodesPackage.EXTENSION__EXTENSIONS);
}
return extensions;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ExtNodesPackage.EXTENSION__EXTENSIONS:
return ((InternalEList<?>) getExtensions()).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 ExtNodesPackage.EXTENSION__EXTENSIONS:
return getExtensions();
}
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 ExtNodesPackage.EXTENSION__EXTENSIONS:
getExtensions().clear();
getExtensions().addAll((Collection<? extends ExtendedNode>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExtNodesPackage.EXTENSION__EXTENSIONS:
getExtensions().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExtNodesPackage.EXTENSION__EXTENSIONS:
return extensions != null && !extensions.isEmpty();
}
return super.eIsSet(featureID);
}
} // ExtensionImpl