/**
* Copyright (c) 2011-2012 Obeo.
* 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:
* Obeo - initial API and implementation
*
*/
package org.obeonetwork.dsl.togaf.contentfwk.contentfwk.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.obeonetwork.dsl.togaf.contentfwk.contentfwk.ContentfwkPackage;
import org.obeonetwork.dsl.togaf.contentfwk.contentfwk.Control;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Control</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.obeonetwork.dsl.togaf.contentfwk.contentfwk.impl.ControlImpl#getEnsuresCorrectOperationOfProcesses <em>Ensures Correct Operation Of Processes</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ControlImpl extends ElementImpl implements Control {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ControlImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ContentfwkPackage.Literals.CONTROL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
public EList<org.obeonetwork.dsl.togaf.contentfwk.contentfwk.Process> getEnsuresCorrectOperationOfProcesses() {
return (EList<org.obeonetwork.dsl.togaf.contentfwk.contentfwk.Process>)eDynamicGet(ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES, ContentfwkPackage.Literals.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES, true, true);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getEnsuresCorrectOperationOfProcesses()).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 ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
return ((InternalEList<?>)getEnsuresCorrectOperationOfProcesses()).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 ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
return getEnsuresCorrectOperationOfProcesses();
}
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 ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
getEnsuresCorrectOperationOfProcesses().clear();
getEnsuresCorrectOperationOfProcesses().addAll((Collection<? extends org.obeonetwork.dsl.togaf.contentfwk.contentfwk.Process>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
getEnsuresCorrectOperationOfProcesses().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ContentfwkPackage.CONTROL__ENSURES_CORRECT_OPERATION_OF_PROCESSES:
return !getEnsuresCorrectOperationOfProcesses().isEmpty();
}
return super.eIsSet(featureID);
}
} //ControlImpl