220 lines
5.1 KiB
Java
220 lines
5.1 KiB
Java
/**
|
|
*/
|
|
package fr.tpt.mem4csd.loss.impl;
|
|
|
|
import fr.tpt.mem4csd.loss.Complex;
|
|
import fr.tpt.mem4csd.loss.LossPackage;
|
|
import fr.tpt.mem4csd.loss.Primitive;
|
|
|
|
import java.util.Collection;
|
|
|
|
import org.eclipse.emf.common.notify.Notification;
|
|
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.EObject;
|
|
import org.eclipse.emf.ecore.InternalEObject;
|
|
|
|
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
|
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>Complex</b></em>'.
|
|
* <!-- end-user-doc -->
|
|
* <p>
|
|
* The following features are implemented:
|
|
* </p>
|
|
* <ul>
|
|
* <li>{@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getPrimitives <em>Primitives</em>}</li>
|
|
* <li>{@link fr.tpt.mem4csd.loss.impl.ComplexImpl#getReference <em>Reference</em>}</li>
|
|
* </ul>
|
|
*
|
|
* @generated
|
|
*/
|
|
public class ComplexImpl extends NamedObjectImpl implements Complex {
|
|
/**
|
|
* The cached value of the '{@link #getPrimitives() <em>Primitives</em>}' containment reference list.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getPrimitives()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EList<Primitive> primitives;
|
|
|
|
/**
|
|
* The cached value of the '{@link #getReference() <em>Reference</em>}' reference.
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @see #getReference()
|
|
* @generated
|
|
* @ordered
|
|
*/
|
|
protected EObject reference;
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
protected ComplexImpl() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
protected EClass eStaticClass() {
|
|
return LossPackage.Literals.COMPLEX;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EList<Primitive> getPrimitives() {
|
|
if (primitives == null) {
|
|
primitives = new EObjectContainmentEList<Primitive>(Primitive.class, this, LossPackage.COMPLEX__PRIMITIVES);
|
|
}
|
|
return primitives;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public EObject getReference() {
|
|
if (reference != null && reference.eIsProxy()) {
|
|
InternalEObject oldReference = (InternalEObject) reference;
|
|
reference = eResolveProxy(oldReference);
|
|
if (reference != oldReference) {
|
|
if (eNotificationRequired())
|
|
eNotify(new ENotificationImpl(this, Notification.RESOLVE, LossPackage.COMPLEX__REFERENCE,
|
|
oldReference, reference));
|
|
}
|
|
}
|
|
return reference;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
public EObject basicGetReference() {
|
|
return reference;
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public void setReference(EObject newReference) {
|
|
EObject oldReference = reference;
|
|
reference = newReference;
|
|
if (eNotificationRequired())
|
|
eNotify(new ENotificationImpl(this, Notification.SET, LossPackage.COMPLEX__REFERENCE, oldReference,
|
|
reference));
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
|
switch (featureID) {
|
|
case LossPackage.COMPLEX__PRIMITIVES:
|
|
return ((InternalEList<?>) getPrimitives()).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 LossPackage.COMPLEX__PRIMITIVES:
|
|
return getPrimitives();
|
|
case LossPackage.COMPLEX__REFERENCE:
|
|
if (resolve)
|
|
return getReference();
|
|
return basicGetReference();
|
|
}
|
|
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 LossPackage.COMPLEX__PRIMITIVES:
|
|
getPrimitives().clear();
|
|
getPrimitives().addAll((Collection<? extends Primitive>) newValue);
|
|
return;
|
|
case LossPackage.COMPLEX__REFERENCE:
|
|
setReference((EObject) newValue);
|
|
return;
|
|
}
|
|
super.eSet(featureID, newValue);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public void eUnset(int featureID) {
|
|
switch (featureID) {
|
|
case LossPackage.COMPLEX__PRIMITIVES:
|
|
getPrimitives().clear();
|
|
return;
|
|
case LossPackage.COMPLEX__REFERENCE:
|
|
setReference((EObject) null);
|
|
return;
|
|
}
|
|
super.eUnset(featureID);
|
|
}
|
|
|
|
/**
|
|
* <!-- begin-user-doc -->
|
|
* <!-- end-user-doc -->
|
|
* @generated
|
|
*/
|
|
@Override
|
|
public boolean eIsSet(int featureID) {
|
|
switch (featureID) {
|
|
case LossPackage.COMPLEX__PRIMITIVES:
|
|
return primitives != null && !primitives.isEmpty();
|
|
case LossPackage.COMPLEX__REFERENCE:
|
|
return reference != null;
|
|
}
|
|
return super.eIsSet(featureID);
|
|
}
|
|
|
|
} //ComplexImpl
|