| /** |
| * Copyright (c) 2016 CEA LIST and others. |
| * |
| * 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.interoperability.rpy.rpymetamodel.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| 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.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.IDescription; |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.IStateVertex; |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.IStereotype; |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.UMLRpyPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>IState Vertex</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getModifiedTimeWeak <em>Modified Time Weak</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getUmlDependencyID <em>Uml Dependency ID</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getMyState <em>My State</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getStereotypes <em>Stereotypes</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getObjectCreation <em>Object Creation</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.IStateVertexImpl#getName <em>Name</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class IStateVertexImpl extends IModelElementImpl implements IStateVertex { |
| /** |
| * The cached value of the '{@link #getModifiedTimeWeak() <em>Modified Time Weak</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModifiedTimeWeak() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> modifiedTimeWeak; |
| |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected IDescription description; |
| |
| /** |
| * The default value of the '{@link #getUmlDependencyID() <em>Uml Dependency ID</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUmlDependencyID() |
| * @generated |
| * @ordered |
| */ |
| protected static final String UML_DEPENDENCY_ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getUmlDependencyID() <em>Uml Dependency ID</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUmlDependencyID() |
| * @generated |
| * @ordered |
| */ |
| protected String umlDependencyID = UML_DEPENDENCY_ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMyState() <em>My State</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMyState() |
| * @generated |
| * @ordered |
| */ |
| protected static final String MY_STATE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getMyState() <em>My State</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMyState() |
| * @generated |
| * @ordered |
| */ |
| protected String myState = MY_STATE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getStereotypes() <em>Stereotypes</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStereotypes() |
| * @generated |
| * @ordered |
| */ |
| protected IStereotype stereotypes; |
| |
| /** |
| * The default value of the '{@link #getObjectCreation() <em>Object Creation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getObjectCreation() |
| * @generated |
| * @ordered |
| */ |
| protected static final String OBJECT_CREATION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getObjectCreation() <em>Object Creation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getObjectCreation() |
| * @generated |
| * @ordered |
| */ |
| protected String objectCreation = OBJECT_CREATION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected IStateVertexImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UMLRpyPackage.eINSTANCE.getIStateVertex(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getModifiedTimeWeak() { |
| if (modifiedTimeWeak == null) { |
| modifiedTimeWeak = new EDataTypeEList<String>(String.class, this, UMLRpyPackage.ISTATE_VERTEX__MODIFIED_TIME_WEAK); |
| } |
| return modifiedTimeWeak; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IDescription getDescription() { |
| if (description != null && description.eIsProxy()) { |
| InternalEObject oldDescription = (InternalEObject)description; |
| description = (IDescription)eResolveProxy(oldDescription); |
| if (description != oldDescription) { |
| InternalEObject newDescription = (InternalEObject)description; |
| NotificationChain msgs = oldDescription.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, null, null); |
| if (newDescription.eInternalContainer() == null) { |
| msgs = newDescription.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, null, msgs); |
| } |
| if (msgs != null) msgs.dispatch(); |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, oldDescription, description)); |
| } |
| } |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IDescription basicGetDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDescription(IDescription newDescription, NotificationChain msgs) { |
| IDescription oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, oldDescription, newDescription); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(IDescription newDescription) { |
| if (newDescription != description) { |
| NotificationChain msgs = null; |
| if (description != null) |
| msgs = ((InternalEObject)description).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, null, msgs); |
| if (newDescription != null) |
| msgs = ((InternalEObject)newDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, null, msgs); |
| msgs = basicSetDescription(newDescription, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION, newDescription, newDescription)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getUmlDependencyID() { |
| return umlDependencyID; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUmlDependencyID(String newUmlDependencyID) { |
| String oldUmlDependencyID = umlDependencyID; |
| umlDependencyID = newUmlDependencyID; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__UML_DEPENDENCY_ID, oldUmlDependencyID, umlDependencyID)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getMyState() { |
| return myState; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMyState(String newMyState) { |
| String oldMyState = myState; |
| myState = newMyState; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__MY_STATE, oldMyState, myState)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IStereotype getStereotypes() { |
| if (stereotypes != null && stereotypes.eIsProxy()) { |
| InternalEObject oldStereotypes = (InternalEObject)stereotypes; |
| stereotypes = (IStereotype)eResolveProxy(oldStereotypes); |
| if (stereotypes != oldStereotypes) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES, oldStereotypes, stereotypes)); |
| } |
| } |
| return stereotypes; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public IStereotype basicGetStereotypes() { |
| return stereotypes; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStereotypes(IStereotype newStereotypes) { |
| IStereotype oldStereotypes = stereotypes; |
| stereotypes = newStereotypes; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES, oldStereotypes, stereotypes)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getObjectCreation() { |
| return objectCreation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setObjectCreation(String newObjectCreation) { |
| String oldObjectCreation = objectCreation; |
| objectCreation = newObjectCreation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__OBJECT_CREATION, oldObjectCreation, objectCreation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.ISTATE_VERTEX__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION: |
| return basicSetDescription(null, 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 UMLRpyPackage.ISTATE_VERTEX__MODIFIED_TIME_WEAK: |
| return getModifiedTimeWeak(); |
| case UMLRpyPackage.ISTATE_VERTEX__ID: |
| return getId(); |
| case UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION: |
| if (resolve) return getDescription(); |
| return basicGetDescription(); |
| case UMLRpyPackage.ISTATE_VERTEX__UML_DEPENDENCY_ID: |
| return getUmlDependencyID(); |
| case UMLRpyPackage.ISTATE_VERTEX__MY_STATE: |
| return getMyState(); |
| case UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES: |
| if (resolve) return getStereotypes(); |
| return basicGetStereotypes(); |
| case UMLRpyPackage.ISTATE_VERTEX__OBJECT_CREATION: |
| return getObjectCreation(); |
| case UMLRpyPackage.ISTATE_VERTEX__NAME: |
| return getName(); |
| } |
| 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 UMLRpyPackage.ISTATE_VERTEX__MODIFIED_TIME_WEAK: |
| getModifiedTimeWeak().clear(); |
| getModifiedTimeWeak().addAll((Collection<? extends String>)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__ID: |
| setId((String)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION: |
| setDescription((IDescription)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__UML_DEPENDENCY_ID: |
| setUmlDependencyID((String)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__MY_STATE: |
| setMyState((String)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES: |
| setStereotypes((IStereotype)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__OBJECT_CREATION: |
| setObjectCreation((String)newValue); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__NAME: |
| setName((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UMLRpyPackage.ISTATE_VERTEX__MODIFIED_TIME_WEAK: |
| getModifiedTimeWeak().clear(); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION: |
| setDescription((IDescription)null); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__UML_DEPENDENCY_ID: |
| setUmlDependencyID(UML_DEPENDENCY_ID_EDEFAULT); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__MY_STATE: |
| setMyState(MY_STATE_EDEFAULT); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES: |
| setStereotypes((IStereotype)null); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__OBJECT_CREATION: |
| setObjectCreation(OBJECT_CREATION_EDEFAULT); |
| return; |
| case UMLRpyPackage.ISTATE_VERTEX__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UMLRpyPackage.ISTATE_VERTEX__MODIFIED_TIME_WEAK: |
| return modifiedTimeWeak != null && !modifiedTimeWeak.isEmpty(); |
| case UMLRpyPackage.ISTATE_VERTEX__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case UMLRpyPackage.ISTATE_VERTEX__DESCRIPTION: |
| return description != null; |
| case UMLRpyPackage.ISTATE_VERTEX__UML_DEPENDENCY_ID: |
| return UML_DEPENDENCY_ID_EDEFAULT == null ? umlDependencyID != null : !UML_DEPENDENCY_ID_EDEFAULT.equals(umlDependencyID); |
| case UMLRpyPackage.ISTATE_VERTEX__MY_STATE: |
| return MY_STATE_EDEFAULT == null ? myState != null : !MY_STATE_EDEFAULT.equals(myState); |
| case UMLRpyPackage.ISTATE_VERTEX__STEREOTYPES: |
| return stereotypes != null; |
| case UMLRpyPackage.ISTATE_VERTEX__OBJECT_CREATION: |
| return OBJECT_CREATION_EDEFAULT == null ? objectCreation != null : !OBJECT_CREATION_EDEFAULT.equals(objectCreation); |
| case UMLRpyPackage.ISTATE_VERTEX__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (modifiedTimeWeak: "); //$NON-NLS-1$ |
| result.append(modifiedTimeWeak); |
| result.append(", id: "); //$NON-NLS-1$ |
| result.append(id); |
| result.append(", umlDependencyID: "); //$NON-NLS-1$ |
| result.append(umlDependencyID); |
| result.append(", myState: "); //$NON-NLS-1$ |
| result.append(myState); |
| result.append(", objectCreation: "); //$NON-NLS-1$ |
| result.append(objectCreation); |
| result.append(", name: "); //$NON-NLS-1$ |
| result.append(name); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //IStateVertexImpl |