blob: 9c88b0e81b745501a795730f6971c41d8b550143 [file] [log] [blame]
/**
* Copyright (c) 2020 CEA LIST.
*
* 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\n\nContributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.ecore.formalml.specification.impl;
import java.util.Collection;
import org.eclipse.efm.ecore.formalml.specification.SpecificationPackage;
import org.eclipse.efm.ecore.formalml.specification.XliaNamedElement;
import org.eclipse.efm.ecore.formalml.specification.XliaObject;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Xlia Object</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.ecore.formalml.specification.impl.XliaObjectImpl#getElements <em>Elements</em>}</li>
* </ul>
*
* @generated
*/
public class XliaObjectImpl extends XliaNamedElementImpl implements XliaObject {
/**
* The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getElements()
* @generated
* @ordered
*/
protected EList<XliaNamedElement> elements;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected XliaObjectImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SpecificationPackage.Literals.XLIA_OBJECT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<XliaNamedElement> getElements() {
if (elements == null) {
elements = new EObjectContainmentEList<XliaNamedElement>(XliaNamedElement.class, this, SpecificationPackage.XLIA_OBJECT__ELEMENTS);
}
return elements;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case SpecificationPackage.XLIA_OBJECT__ELEMENTS:
return ((InternalEList<?>)getElements()).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 SpecificationPackage.XLIA_OBJECT__ELEMENTS:
return getElements();
}
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 SpecificationPackage.XLIA_OBJECT__ELEMENTS:
getElements().clear();
getElements().addAll((Collection<? extends XliaNamedElement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case SpecificationPackage.XLIA_OBJECT__ELEMENTS:
getElements().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case SpecificationPackage.XLIA_OBJECT__ELEMENTS:
return elements != null && !elements.isEmpty();
}
return super.eIsSet(featureID);
}
} //XliaObjectImpl