/**
*/
package ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Transition;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.Vertex;
import ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.YakinduPackage;
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.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Vertex'.
*
*
* The following features are implemented:
*
*
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl.VertexImpl#getIncomingTransitions Incoming Transitions}
* - {@link ca.mcgill.ecse.dslreasoner.standalone.test.yakindu.impl.VertexImpl#getOutgoingTransitions Outgoing Transitions}
*
*
* @generated
*/
public abstract class VertexImpl extends MinimalEObjectImpl.Container implements Vertex {
/**
* The cached value of the '{@link #getIncomingTransitions() Incoming Transitions}' reference list.
*
*
* @see #getIncomingTransitions()
* @generated
* @ordered
*/
protected EList incomingTransitions;
/**
* The cached value of the '{@link #getOutgoingTransitions() Outgoing Transitions}' containment reference list.
*
*
* @see #getOutgoingTransitions()
* @generated
* @ordered
*/
protected EList outgoingTransitions;
/**
*
*
* @generated
*/
protected VertexImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return YakinduPackage.Literals.VERTEX;
}
/**
*
*
* @generated
*/
public EList getIncomingTransitions() {
if (incomingTransitions == null) {
incomingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, YakinduPackage.VERTEX__INCOMING_TRANSITIONS, YakinduPackage.TRANSITION__TARGET);
}
return incomingTransitions;
}
/**
*
*
* @generated
*/
public EList getOutgoingTransitions() {
if (outgoingTransitions == null) {
outgoingTransitions = new EObjectContainmentWithInverseEList(Transition.class, this, YakinduPackage.VERTEX__OUTGOING_TRANSITIONS, YakinduPackage.TRANSITION__SOURCE);
}
return outgoingTransitions;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
return ((InternalEList)(InternalEList>)getIncomingTransitions()).basicAdd(otherEnd, msgs);
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
return ((InternalEList)(InternalEList>)getOutgoingTransitions()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
return ((InternalEList>)getIncomingTransitions()).basicRemove(otherEnd, msgs);
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
return ((InternalEList>)getOutgoingTransitions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
return getIncomingTransitions();
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
return getOutgoingTransitions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
getIncomingTransitions().clear();
getIncomingTransitions().addAll((Collection extends Transition>)newValue);
return;
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
getOutgoingTransitions().clear();
getOutgoingTransitions().addAll((Collection extends Transition>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
getIncomingTransitions().clear();
return;
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
getOutgoingTransitions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case YakinduPackage.VERTEX__INCOMING_TRANSITIONS:
return incomingTransitions != null && !incomingTransitions.isEmpty();
case YakinduPackage.VERTEX__OUTGOING_TRANSITIONS:
return outgoingTransitions != null && !outgoingTransitions.isEmpty();
}
return super.eIsSet(featureID);
}
} //VertexImpl