/**
*/
package hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl;
import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.Transition;
import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.Vertex;
import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage;
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 hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.VertexImpl#getIncomingTransitions Incoming Transitions}
* - {@link hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.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 YakindummPackage.Literals.VERTEX;
}
/**
*
*
* @generated
*/
public EList getIncomingTransitions() {
if (incomingTransitions == null) {
incomingTransitions = new EObjectWithInverseResolvingEList(Transition.class, this, YakindummPackage.VERTEX__INCOMING_TRANSITIONS, YakindummPackage.TRANSITION__TARGET);
}
return incomingTransitions;
}
/**
*
*
* @generated
*/
public EList getOutgoingTransitions() {
if (outgoingTransitions == null) {
outgoingTransitions = new EObjectContainmentWithInverseEList(Transition.class, this, YakindummPackage.VERTEX__OUTGOING_TRANSITIONS, YakindummPackage.TRANSITION__SOURCE);
}
return outgoingTransitions;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
return ((InternalEList)(InternalEList>)getIncomingTransitions()).basicAdd(otherEnd, msgs);
case YakindummPackage.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 YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
return ((InternalEList>)getIncomingTransitions()).basicRemove(otherEnd, msgs);
case YakindummPackage.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 YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
return getIncomingTransitions();
case YakindummPackage.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 YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
getIncomingTransitions().clear();
getIncomingTransitions().addAll((Collection extends Transition>)newValue);
return;
case YakindummPackage.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 YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
getIncomingTransitions().clear();
return;
case YakindummPackage.VERTEX__OUTGOING_TRANSITIONS:
getOutgoingTransitions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case YakindummPackage.VERTEX__INCOMING_TRANSITIONS:
return incomingTransitions != null && !incomingTransitions.isEmpty();
case YakindummPackage.VERTEX__OUTGOING_TRANSITIONS:
return outgoingTransitions != null && !outgoingTransitions.isEmpty();
}
return super.eIsSet(featureID);
}
} //VertexImpl