blob: b0aec598a12cc94cfa3a5bea33a243cc09f3e8c3 [file] [log] [blame]
/**
* Copyright (c) 2016 Willink Transformations, Univesity of York and others.
* 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
*/
package delphi.impl;
import delphi.DelphiPackage;
import delphi.MultipleConstExp;
import delphi.constExpr;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Multiple Const Exp</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link delphi.impl.MultipleConstExpImpl#getExps <em>Exps</em>}</li>
* </ul>
*
* @generated
*/
public class MultipleConstExpImpl extends constExprImpl implements MultipleConstExp {
/**
* The cached value of the '{@link #getExps() <em>Exps</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExps()
* @generated
* @ordered
*/
protected EList<constExpr> exps;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MultipleConstExpImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DelphiPackage.Literals.MULTIPLE_CONST_EXP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<constExpr> getExps() {
if (exps == null) {
exps = new EObjectContainmentEList<constExpr>(constExpr.class, this, DelphiPackage.MULTIPLE_CONST_EXP__EXPS);
}
return exps;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DelphiPackage.MULTIPLE_CONST_EXP__EXPS:
return ((InternalEList<?>)getExps()).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 DelphiPackage.MULTIPLE_CONST_EXP__EXPS:
return getExps();
}
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 DelphiPackage.MULTIPLE_CONST_EXP__EXPS:
getExps().clear();
getExps().addAll((Collection<? extends constExpr>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DelphiPackage.MULTIPLE_CONST_EXP__EXPS:
getExps().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DelphiPackage.MULTIPLE_CONST_EXP__EXPS:
return exps != null && !exps.isEmpty();
}
return super.eIsSet(featureID);
}
} //MultipleConstExpImpl