/** | |
* <copyright> | |
* Copyright (c) 2009, 2010 Open Canarias, S.L. | |
* 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: | |
* Adolfo Sanchez-Barbudo Herrera - Initial API and implementation | |
* | |
* </copyright> | |
*/ | |
package org.eclipse.modisco.omg.gastm.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.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
import org.eclipse.modisco.omg.gastm.CaseBlock; | |
import org.eclipse.modisco.omg.gastm.Expression; | |
import org.eclipse.modisco.omg.gastm.GASTMPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Case Block</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.modisco.omg.gastm.impl.CaseBlockImpl#getCaseExpressions <em>Case Expressions</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class CaseBlockImpl extends SwitchCaseImpl implements CaseBlock { | |
/** | |
* The cached value of the '{@link #getCaseExpressions() <em>Case Expressions</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getCaseExpressions() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Expression> caseExpressions; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected CaseBlockImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return GASTMPackage.eINSTANCE.getCaseBlock(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EList<Expression> getCaseExpressions() { | |
if (caseExpressions == null) { | |
caseExpressions = new EObjectContainmentEList<Expression>(Expression.class, this, GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS); | |
} | |
return caseExpressions; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS: | |
return ((InternalEList<?>)getCaseExpressions()).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 GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS: | |
return getCaseExpressions(); | |
} | |
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 GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS: | |
getCaseExpressions().clear(); | |
getCaseExpressions().addAll((Collection<? extends Expression>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS: | |
getCaseExpressions().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case GASTMPackage.CASE_BLOCK__CASE_EXPRESSIONS: | |
return caseExpressions != null && !caseExpressions.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //CaseBlockImpl |