org.nasdanika.models.architecture.impl.RelationshipTargetImpl 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.Relationship;
import org.nasdanika.models.architecture.RelationshipTarget;
/**
*
* An implementation of the model object 'Relationship Target'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.architecture.impl.RelationshipTargetImpl#getIncomingConnections Incoming Connections}
*
*
* @generated
*/
public class RelationshipTargetImpl extends ArchitectureDescriptionElementImpl implements RelationshipTarget {
/**
*
*
* @generated
*/
protected RelationshipTargetImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArchitecturePackage.Literals.RELATIONSHIP_TARGET;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getIncomingConnections() {
return (EList)eDynamicGet(ArchitecturePackage.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__INCOMING_CONNECTIONS:
getIncomingConnections().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArchitecturePackage.RELATIONSHIP_TARGET__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.RELATIONSHIP_TARGET__INCOMING_CONNECTIONS: return ModelPackage.CONNECTION_TARGET__INCOMING_CONNECTIONS;
default: return -1;
}
}
if (baseClass == DocumentedNamedConnectionTarget.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.RELATIONSHIP_TARGET__INCOMING_CONNECTIONS;
default: return -1;
}
}
if (baseClass == DocumentedNamedConnectionTarget.class) {
switch (baseFeatureID) {
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //RelationshipTargetImpl