123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- /**
- */
- package ua.ansymo.hintco.impl;
- import java.lang.reflect.InvocationTargetException;
- 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.EcoreUtil;
- import ua.ansymo.hintco.DecompositionPortAdaptation;
- import ua.ansymo.hintco.HintcoPackage;
- import ua.ansymo.hintco.PortAdaptation;
- import ua.ansymo.hintco.PortInstance;
- /**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Port Adaptation</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * </p>
- * <ul>
- * <li>{@link ua.ansymo.hintco.impl.PortAdaptationImpl#getPort <em>Port</em>}</li>
- * <li>{@link ua.ansymo.hintco.impl.PortAdaptationImpl#getParent <em>Parent</em>}</li>
- * </ul>
- *
- * @generated
- */
- public abstract class PortAdaptationImpl extends AdaptationImpl implements PortAdaptation {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PortAdaptationImpl() {
- super();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return HintcoPackage.Literals.PORT_ADAPTATION;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PortInstance getPort() {
- if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT) return null;
- return (PortInstance)eContainer();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PortInstance basicGetPort() {
- if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT) return null;
- return (PortInstance)eInternalContainer();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPort(PortInstance newPort, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newPort, HintcoPackage.PORT_ADAPTATION__PORT, msgs);
- return msgs;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPort(PortInstance newPort) {
- if (newPort != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT && newPort != null)) {
- if (EcoreUtil.isAncestor(this, newPort))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newPort != null)
- msgs = ((InternalEObject)newPort).eInverseAdd(this, HintcoPackage.PORT_INSTANCE__ADAPTATION, PortInstance.class, msgs);
- msgs = basicSetPort(newPort, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_ADAPTATION__PORT, newPort, newPort));
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DecompositionPortAdaptation getParent() {
- if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT) return null;
- return (DecompositionPortAdaptation)eContainer();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DecompositionPortAdaptation basicGetParent() {
- if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT) return null;
- return (DecompositionPortAdaptation)eInternalContainer();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetParent(DecompositionPortAdaptation newParent, NotificationChain msgs) {
- msgs = eBasicSetContainer((InternalEObject)newParent, HintcoPackage.PORT_ADAPTATION__PARENT, msgs);
- return msgs;
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setParent(DecompositionPortAdaptation newParent) {
- if (newParent != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT && newParent != null)) {
- if (EcoreUtil.isAncestor(this, newParent))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newParent != null)
- msgs = ((InternalEObject)newParent).eInverseAdd(this, HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN, DecompositionPortAdaptation.class, msgs);
- msgs = basicSetParent(newParent, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_ADAPTATION__PARENT, newParent, newParent));
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PortInstance adapted() {
- PortInstance _port = this.getPort();
- boolean _tripleNotEquals = (_port != null);
- if (_tripleNotEquals) {
- return this.getPort();
- }
- DecompositionPortAdaptation _parent = this.getParent();
- boolean _tripleEquals = (_parent == null);
- if (_tripleEquals) {
- return null;
- }
- return this.getParent().adapted();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetPort((PortInstance)otherEnd, msgs);
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- if (eInternalContainer() != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return basicSetParent((DecompositionPortAdaptation)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 HintcoPackage.PORT_ADAPTATION__PORT:
- return basicSetPort(null, msgs);
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- return basicSetParent(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
- switch (eContainerFeatureID()) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- return eInternalContainer().eInverseRemove(this, HintcoPackage.PORT_INSTANCE__ADAPTATION, PortInstance.class, msgs);
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- return eInternalContainer().eInverseRemove(this, HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN, DecompositionPortAdaptation.class, msgs);
- }
- return super.eBasicRemoveFromContainerFeature(msgs);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- if (resolve) return getPort();
- return basicGetPort();
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- if (resolve) return getParent();
- return basicGetParent();
- }
- return super.eGet(featureID, resolve, coreType);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- setPort((PortInstance)newValue);
- return;
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- setParent((DecompositionPortAdaptation)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- setPort((PortInstance)null);
- return;
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- setParent((DecompositionPortAdaptation)null);
- return;
- }
- super.eUnset(featureID);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case HintcoPackage.PORT_ADAPTATION__PORT:
- return basicGetPort() != null;
- case HintcoPackage.PORT_ADAPTATION__PARENT:
- return basicGetParent() != null;
- }
- return super.eIsSet(featureID);
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
- switch (operationID) {
- case HintcoPackage.PORT_ADAPTATION___ADAPTED:
- return adapted();
- }
- return super.eInvoke(operationID, arguments);
- }
- } //PortAdaptationImpl
|