| /** |
| */ |
| package flowchart.impl; |
| |
| import flowchart.Flowchart; |
| import flowchart.FlowchartPackage; |
| import flowchart.Node; |
| import flowchart.Transition; |
| |
| 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.EObjectImpl; |
| |
| 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>Flowchart</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link flowchart.impl.FlowchartImpl#getNodes <em>Nodes</em>}</li> |
| * <li>{@link flowchart.impl.FlowchartImpl#getTransitions <em>Transitions</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class FlowchartImpl extends EObjectImpl implements Flowchart |
| { |
| /** |
| * The cached value of the '{@link #getNodes() <em>Nodes</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNodes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Node> nodes; |
| |
| /** |
| * The cached value of the '{@link #getTransitions() <em>Transitions</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTransitions() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Transition> transitions; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FlowchartImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return FlowchartPackage.Literals.FLOWCHART; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Node> getNodes() |
| { |
| if (nodes == null) |
| { |
| nodes = new EObjectContainmentEList<Node>(Node.class, this, FlowchartPackage.FLOWCHART__NODES); |
| } |
| return nodes; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Transition> getTransitions() |
| { |
| if (transitions == null) |
| { |
| transitions = new EObjectContainmentEList<Transition>(Transition.class, this, FlowchartPackage.FLOWCHART__TRANSITIONS); |
| } |
| return transitions; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case FlowchartPackage.FLOWCHART__NODES: |
| return ((InternalEList<?>)getNodes()).basicRemove(otherEnd, msgs); |
| case FlowchartPackage.FLOWCHART__TRANSITIONS: |
| return ((InternalEList<?>)getTransitions()).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 FlowchartPackage.FLOWCHART__NODES: |
| return getNodes(); |
| case FlowchartPackage.FLOWCHART__TRANSITIONS: |
| return getTransitions(); |
| } |
| 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 FlowchartPackage.FLOWCHART__NODES: |
| getNodes().clear(); |
| getNodes().addAll((Collection<? extends Node>)newValue); |
| return; |
| case FlowchartPackage.FLOWCHART__TRANSITIONS: |
| getTransitions().clear(); |
| getTransitions().addAll((Collection<? extends Transition>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case FlowchartPackage.FLOWCHART__NODES: |
| getNodes().clear(); |
| return; |
| case FlowchartPackage.FLOWCHART__TRANSITIONS: |
| getTransitions().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case FlowchartPackage.FLOWCHART__NODES: |
| return nodes != null && !nodes.isEmpty(); |
| case FlowchartPackage.FLOWCHART__TRANSITIONS: |
| return transitions != null && !transitions.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //FlowchartImpl |