blob: a29f279858304d37f6abd43f5af7a80304759de2 [file] [log] [blame]
/*******************************************************************************
* <copyright>
*
* Copyright (c) 2013, 2013 SAP AG.
* 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:
* SAP AG - initial API, implementation and documentation
*
* </copyright>
*
*******************************************************************************/
package org.eclipse.fmc.mm.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.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.fmc.mm.Access;
import org.eclipse.fmc.mm.FmcPackage;
import org.eclipse.fmc.mm.IFMCElementVisitor;
import org.eclipse.fmc.mm.StructureVariance;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Structure Variance</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.fmc.mm.impl.StructureVarianceImpl#getConnections <em>Connections</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StructureVarianceImpl extends FMCNodeImpl implements StructureVariance {
/**
* The cached value of the '{@link #getConnections() <em>Connections</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConnections()
* @generated
* @ordered
*/
protected EList<Access> connections;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StructureVarianceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FmcPackage.Literals.STRUCTURE_VARIANCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Access> getConnections() {
if (connections == null) {
connections = new EObjectWithInverseResolvingEList<Access>(Access.class, this, FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS, FmcPackage.ACCESS__TARGET);
}
return connections;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getConnections()).basicAdd(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 FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
return ((InternalEList<?>)getConnections()).basicRemove(otherEnd, 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 FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
return getConnections();
}
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 FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
getConnections().clear();
getConnections().addAll((Collection<? extends Access>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
getConnections().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FmcPackage.STRUCTURE_VARIANCE__CONNECTIONS:
return connections != null && !connections.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public Object accept(IFMCElementVisitor visitor, Object object) {
return visitor.visitStructureVariance(this, object);
}
} //StructureVarianceImpl