org.nasdanika.models.architecture.impl.NodeImpl Maven / Gradle / Ivy
The newest version!
/**
*/
package org.nasdanika.models.architecture.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.InternalEList;
import org.nasdanika.graph.model.ConnectionTarget;
import org.nasdanika.graph.model.DocumentedNamedConnectionTarget;
import org.nasdanika.graph.model.ModelPackage;
import org.nasdanika.models.architecture.ArchitecturePackage;
import org.nasdanika.models.architecture.Node;
import org.nasdanika.models.architecture.Relationship;
import org.nasdanika.models.architecture.RelationshipTarget;
/**
*
* An implementation of the model object 'Node'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.architecture.impl.NodeImpl#getIncomingConnections Incoming Connections}
*
*
* @generated
*/
public class NodeImpl extends RelationshipSourceImpl implements Node {
/**
*
*
* @generated
*/
protected NodeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArchitecturePackage.Literals.NODE;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getIncomingConnections() {
return (EList)eDynamicGet(ArchitecturePackage.NODE__INCOMING_CONNECTIONS, ModelPackage.Literals.CONNECTION_TARGET__INCOMING_CONNECTIONS, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
return ((InternalEList)(InternalEList>)getIncomingConnections()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
return ((InternalEList>)getIncomingConnections()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
return getIncomingConnections();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
getIncomingConnections().clear();
getIncomingConnections().addAll((Collection extends Relationship>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
getIncomingConnections().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS:
return !getIncomingConnections().isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == ConnectionTarget.class) {
switch (derivedFeatureID) {
case ArchitecturePackage.NODE__INCOMING_CONNECTIONS: return ModelPackage.CONNECTION_TARGET__INCOMING_CONNECTIONS;
default: return -1;
}
}
if (baseClass == DocumentedNamedConnectionTarget.class) {
switch (derivedFeatureID) {
default: return -1;
}
}
if (baseClass == RelationshipTarget.class) {
switch (derivedFeatureID) {
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == ConnectionTarget.class) {
switch (baseFeatureID) {
case ModelPackage.CONNECTION_TARGET__INCOMING_CONNECTIONS: return ArchitecturePackage.NODE__INCOMING_CONNECTIONS;
default: return -1;
}
}
if (baseClass == DocumentedNamedConnectionTarget.class) {
switch (baseFeatureID) {
default: return -1;
}
}
if (baseClass == RelationshipTarget.class) {
switch (baseFeatureID) {
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //NodeImpl