| /** |
| */ |
| package org.eclipse.papyrus.RobotML.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| 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.ENotificationImpl; |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| import org.eclipse.papyrus.RobotML.ExternalLibrary; |
| import org.eclipse.papyrus.RobotML.Platform; |
| import org.eclipse.papyrus.RobotML.RobotMLPackage; |
| import org.eclipse.uml2.uml.Node; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Platform</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.RobotML.impl.PlatformImpl#getBase_Node <em>Base Node</em>}</li> |
| * <li>{@link org.eclipse.papyrus.RobotML.impl.PlatformImpl#getLibrary <em>Library</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PlatformImpl extends SystemImpl implements Platform { |
| /** |
| * The cached value of the '{@link #getBase_Node() <em>Base Node</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Node() |
| * @generated |
| * @ordered |
| */ |
| protected Node base_Node; |
| |
| /** |
| * The cached value of the '{@link #getLibrary() <em>Library</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLibrary() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ExternalLibrary> library; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PlatformImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return RobotMLPackage.Literals.PLATFORM; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Node getBase_Node() { |
| if (base_Node != null && base_Node.eIsProxy()) { |
| InternalEObject oldBase_Node = (InternalEObject)base_Node; |
| base_Node = (Node)eResolveProxy(oldBase_Node); |
| if (base_Node != oldBase_Node) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, RobotMLPackage.PLATFORM__BASE_NODE, oldBase_Node, base_Node)); |
| } |
| } |
| return base_Node; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Node basicGetBase_Node() { |
| return base_Node; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Node(Node newBase_Node) { |
| Node oldBase_Node = base_Node; |
| base_Node = newBase_Node; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, RobotMLPackage.PLATFORM__BASE_NODE, oldBase_Node, base_Node)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ExternalLibrary> getLibrary() { |
| if (library == null) { |
| library = new EObjectResolvingEList<ExternalLibrary>(ExternalLibrary.class, this, RobotMLPackage.PLATFORM__LIBRARY); |
| } |
| return library; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case RobotMLPackage.PLATFORM__BASE_NODE: |
| if (resolve) return getBase_Node(); |
| return basicGetBase_Node(); |
| case RobotMLPackage.PLATFORM__LIBRARY: |
| return getLibrary(); |
| } |
| 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 RobotMLPackage.PLATFORM__BASE_NODE: |
| setBase_Node((Node)newValue); |
| return; |
| case RobotMLPackage.PLATFORM__LIBRARY: |
| getLibrary().clear(); |
| getLibrary().addAll((Collection<? extends ExternalLibrary>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case RobotMLPackage.PLATFORM__BASE_NODE: |
| setBase_Node((Node)null); |
| return; |
| case RobotMLPackage.PLATFORM__LIBRARY: |
| getLibrary().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case RobotMLPackage.PLATFORM__BASE_NODE: |
| return base_Node != null; |
| case RobotMLPackage.PLATFORM__LIBRARY: |
| return library != null && !library.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // PlatformImpl |