| /** |
| * Copyright (c) 2014 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 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.umldi.impl; |
| |
| 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.util.EObjectContainmentWithInverseEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.papyrus.umldi.ConnectorEdge; |
| import org.eclipse.papyrus.umldi.MultiplicityLabel; |
| import org.eclipse.papyrus.umldi.UMLDIPackage; |
| import org.eclipse.papyrus.umldi.UmlDiagramElement; |
| |
| import org.eclipse.uml2.common.util.DerivedUnionEObjectEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Connector Edge</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.umldi.impl.ConnectorEdgeImpl#getOwnedUmlDiagramElement <em>Owned Uml Diagram Element</em>}</li> |
| * <li>{@link org.eclipse.papyrus.umldi.impl.ConnectorEdgeImpl#getEndMultiplicityLabel <em>End Multiplicity Label</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ConnectorEdgeImpl extends ElementEdgeImpl implements ConnectorEdge { |
| |
| /** |
| * The cached value of the '{@link #getEndMultiplicityLabel() <em>End Multiplicity Label</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getEndMultiplicityLabel() |
| * @generated |
| * @ordered |
| */ |
| protected EList<MultiplicityLabel> endMultiplicityLabel; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected ConnectorEdgeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UMLDIPackage.Literals.CONNECTOR_EDGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EList<UmlDiagramElement> getOwnedUmlDiagramElement() { |
| return new DerivedUnionEObjectEList<UmlDiagramElement>(UmlDiagramElement.class, this, UMLDIPackage.CONNECTOR_EDGE__OWNED_UML_DIAGRAM_ELEMENT, OWNED_UML_DIAGRAM_ELEMENT_ESUBSETS); |
| } |
| |
| /** |
| * The array of subset feature identifiers for the '{@link #getOwnedUmlDiagramElement() <em>Owned Uml Diagram Element</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getOwnedUmlDiagramElement() |
| * @generated |
| * @ordered |
| */ |
| protected static final int[] OWNED_UML_DIAGRAM_ELEMENT_ESUBSETS = new int[]{ UMLDIPackage.CONNECTOR_EDGE__STEREOTYPE_LABEL, UMLDIPackage.CONNECTOR_EDGE__MAIN_LABEL, UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL }; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public EList<MultiplicityLabel> getEndMultiplicityLabel() { |
| if(endMultiplicityLabel == null) { |
| endMultiplicityLabel = new EObjectContainmentWithInverseEList<MultiplicityLabel>(MultiplicityLabel.class, this, UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL, UMLDIPackage.MULTIPLICITY_LABEL__CONNECTOR_EDGE); |
| } |
| return endMultiplicityLabel; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch(featureID) { |
| case UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| return ((InternalEList<InternalEObject>)(InternalEList<?>)getEndMultiplicityLabel()).basicAdd(otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch(featureID) { |
| case UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| return ((InternalEList<?>)getEndMultiplicityLabel()).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 UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| return getEndMultiplicityLabel(); |
| } |
| 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 UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| getEndMultiplicityLabel().clear(); |
| getEndMultiplicityLabel().addAll((Collection<? extends MultiplicityLabel>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch(featureID) { |
| case UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| getEndMultiplicityLabel().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch(featureID) { |
| case UMLDIPackage.CONNECTOR_EDGE__OWNED_UML_DIAGRAM_ELEMENT: |
| return isSetOwnedUmlDiagramElement(); |
| case UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL: |
| return endMultiplicityLabel != null && !endMultiplicityLabel.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean isSetOwnedUmlDiagramElement() { |
| return super.isSetOwnedUmlDiagramElement() || eIsSet(UMLDIPackage.CONNECTOR_EDGE__END_MULTIPLICITY_LABEL); |
| } |
| } //ConnectorEdgeImpl |