blob: 80f71f64e50da55f54de2e600be3edf8cb411d98 [file] [log] [blame]
/**
* Copyright (c) 2018 CEA LIST.
*
* 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:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.ecore.formalml.expression.impl;
import java.util.Collection;
import org.eclipse.efm.ecore.formalml.expression.ExpressionPackage;
import org.eclipse.efm.ecore.formalml.expression.NamedExpression;
import org.eclipse.efm.ecore.formalml.expression.NamedTupleExpression;
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>Named Tuple Expression</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.ecore.formalml.expression.impl.NamedTupleExpressionImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class NamedTupleExpressionImpl extends TupleExpressionImpl implements NamedTupleExpression {
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected EList<NamedExpression> value;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected NamedTupleExpressionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionPackage.Literals.NAMED_TUPLE_EXPRESSION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<NamedExpression> getValue() {
if (value == null) {
value = new EObjectContainmentEList<NamedExpression>(NamedExpression.class, this, ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE);
}
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE:
return ((InternalEList<?>)getValue()).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 ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE:
return getValue();
}
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 ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE:
getValue().clear();
getValue().addAll((Collection<? extends NamedExpression>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE:
getValue().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExpressionPackage.NAMED_TUPLE_EXPRESSION__VALUE:
return value != null && !value.isEmpty();
}
return super.eIsSet(featureID);
}
} //NamedTupleExpressionImpl