blob: 3c037fc21e0850363b64632ce773eaf0be183e61 [file] [log] [blame]
/**
* <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 v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.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.GASTMPackage;
import org.eclipse.modisco.omg.gastm.Type;
import org.eclipse.modisco.omg.gastm.TypesCatchBlock;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Types Catch Block</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.modisco.omg.gastm.impl.TypesCatchBlockImpl#getExceptions <em>Exceptions</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TypesCatchBlockImpl extends CatchBlockImpl implements TypesCatchBlock {
/**
* The cached value of the '{@link #getExceptions() <em>Exceptions</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExceptions()
* @generated
* @ordered
*/
protected EList<Type> exceptions;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypesCatchBlockImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return GASTMPackage.eINSTANCE.getTypesCatchBlock();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Type> getExceptions() {
if (exceptions == null) {
exceptions = new EObjectContainmentEList<Type>(Type.class, this, GASTMPackage.TYPES_CATCH_BLOCK__EXCEPTIONS);
}
return exceptions;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case GASTMPackage.TYPES_CATCH_BLOCK__EXCEPTIONS:
return ((InternalEList<?>)getExceptions()).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.TYPES_CATCH_BLOCK__EXCEPTIONS:
return getExceptions();
}
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.TYPES_CATCH_BLOCK__EXCEPTIONS:
getExceptions().clear();
getExceptions().addAll((Collection<? extends Type>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case GASTMPackage.TYPES_CATCH_BLOCK__EXCEPTIONS:
getExceptions().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case GASTMPackage.TYPES_CATCH_BLOCK__EXCEPTIONS:
return exceptions != null && !exceptions.isEmpty();
}
return super.eIsSet(featureID);
}
} //TypesCatchBlockImpl