blob: b88aa3c0c04830555e4e25ba154cc0e40b11f921 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 Willink Transformations 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:
* E.D.Willink - initial API and implementation
*******************************************************************************/
/**
*/
package example1.source.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 example1.source.SRoot;
import example1.source.SourcePackage;
import example1.source.X;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>SRoot</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link example1.source.impl.SRootImpl#getOwnedX <em>Owned X</em>}</li>
* </ul>
*
* @generated
*/
public class SRootImpl extends SElementImpl implements SRoot {
/**
* The cached value of the '{@link #getOwnedX() <em>Owned X</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedX()
* @generated
* @ordered
*/
protected EList<X> ownedX;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SRootImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SourcePackage.Literals.SROOT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<X> getOwnedX() {
if (ownedX == null) {
ownedX = new EObjectContainmentEList<X>(X.class, this, SourcePackage.SROOT__OWNED_X);
}
return ownedX;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SourcePackage.SROOT__OWNED_X:
return ((InternalEList<?>)getOwnedX()).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 SourcePackage.SROOT__OWNED_X:
return getOwnedX();
}
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 SourcePackage.SROOT__OWNED_X:
getOwnedX().clear();
getOwnedX().addAll((Collection<? extends X>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SourcePackage.SROOT__OWNED_X:
getOwnedX().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SourcePackage.SROOT__OWNED_X:
return ownedX != null && !ownedX.isEmpty();
}
return super.eIsSet(featureID);
}
} //SRootImpl