blob: 292689e3f331c7af7572f16380c75a62ef0c9716 [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2013, 2019 Willink Transformations and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* E.D.Willink - Initial API and implementation
*
* </copyright>
*/
package org.eclipse.qvtd.pivot.qvtschedule.impl;
import java.util.Collection;
import java.util.List;
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.ocl.pivot.internal.ElementImpl;
import org.eclipse.qvtd.pivot.qvtschedule.EdgeConnection;
import org.eclipse.qvtd.pivot.qvtschedule.NavigableEdge;
import org.eclipse.qvtd.pivot.qvtschedule.QVTschedulePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Navigable Edge</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.pivot.qvtschedule.impl.NavigableEdgeImpl#getIncomingConnection <em>Incoming Connection</em>}</li>
* <li>{@link org.eclipse.qvtd.pivot.qvtschedule.impl.NavigableEdgeImpl#getOutgoingConnections <em>Outgoing Connections</em>}</li>
* </ul>
*
* @generated
*/
public abstract class NavigableEdgeImpl extends EdgeImpl implements NavigableEdge {
/**
* The number of structural features of the '<em>Navigable Edge</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
public static final int NAVIGABLE_EDGE_FEATURE_COUNT = EdgeImpl.EDGE_FEATURE_COUNT + 2;
/**
* The number of operations of the '<em>Navigable Edge</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
public static final int NAVIGABLE_EDGE_OPERATION_COUNT = EdgeImpl.EDGE_OPERATION_COUNT + 0;
/**
* The cached value of the '{@link #getIncomingConnection() <em>Incoming Connection</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIncomingConnection()
* @generated
* @ordered
*/
protected EdgeConnection incomingConnection;
/**
* The cached value of the '{@link #getOutgoingConnections() <em>Outgoing Connections</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOutgoingConnections()
* @generated
* @ordered
*/
protected EList<EdgeConnection> outgoingConnections;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NavigableEdgeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTschedulePackage.Literals.NAVIGABLE_EDGE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EdgeConnection getIncomingConnection() {
if (incomingConnection != null && incomingConnection.eIsProxy()) {
InternalEObject oldIncomingConnection = (InternalEObject)incomingConnection;
incomingConnection = (EdgeConnection)eResolveProxy(oldIncomingConnection);
if (incomingConnection != oldIncomingConnection) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ElementImpl.ELEMENT_FEATURE_COUNT + 6, oldIncomingConnection, incomingConnection));
}
}
return incomingConnection;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EdgeConnection basicGetIncomingConnection() {
return incomingConnection;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setIncomingConnection(EdgeConnection newIncomingConnection) {
EdgeConnection oldIncomingConnection = incomingConnection;
incomingConnection = newIncomingConnection;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ElementImpl.ELEMENT_FEATURE_COUNT + 6, oldIncomingConnection, incomingConnection));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<EdgeConnection> getOutgoingConnections() {
if (outgoingConnections == null) {
outgoingConnections = new EObjectResolvingEList<EdgeConnection>(EdgeConnection.class, this, ElementImpl.ELEMENT_FEATURE_COUNT + 7);
}
return outgoingConnections;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ElementImpl.ELEMENT_FEATURE_COUNT + 6:
if (resolve) return getIncomingConnection();
return basicGetIncomingConnection();
case ElementImpl.ELEMENT_FEATURE_COUNT + 7:
return getOutgoingConnections();
}
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 ElementImpl.ELEMENT_FEATURE_COUNT + 6:
setIncomingConnection((EdgeConnection)newValue);
return;
case ElementImpl.ELEMENT_FEATURE_COUNT + 7:
getOutgoingConnections().clear();
getOutgoingConnections().addAll((Collection<? extends EdgeConnection>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ElementImpl.ELEMENT_FEATURE_COUNT + 6:
setIncomingConnection((EdgeConnection)null);
return;
case ElementImpl.ELEMENT_FEATURE_COUNT + 7:
getOutgoingConnections().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ElementImpl.ELEMENT_FEATURE_COUNT + 6:
return incomingConnection != null;
case ElementImpl.ELEMENT_FEATURE_COUNT + 7:
return outgoingConnections != null && !outgoingConnections.isEmpty();
}
return super.eIsSet(featureID);
}
@Override
public final boolean isNavigable() {
return true;
}
} //NavigableEdgeImpl