/** | |
* Copyright (c) 2020 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\n\nContributors: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.statement.impl; | |
import java.util.Collection; | |
import org.eclipse.efm.ecore.formalml.expression.Expression; | |
import org.eclipse.efm.ecore.formalml.statement.InputComStatement; | |
import org.eclipse.efm.ecore.formalml.statement.StatementPackage; | |
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>Input Com Statement</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.statement.impl.InputComStatementImpl#getLeftValue <em>Left Value</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class InputComStatementImpl extends AbstractComStatementImpl implements InputComStatement { | |
/** | |
* The cached value of the '{@link #getLeftValue() <em>Left Value</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getLeftValue() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<Expression> leftValue; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected InputComStatementImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return StatementPackage.Literals.INPUT_COM_STATEMENT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EList<Expression> getLeftValue() { | |
if (leftValue == null) { | |
leftValue = new EObjectContainmentEList<Expression>(Expression.class, this, StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE); | |
} | |
return leftValue; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE: | |
return ((InternalEList<?>)getLeftValue()).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 StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE: | |
return getLeftValue(); | |
} | |
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 StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE: | |
getLeftValue().clear(); | |
getLeftValue().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 StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE: | |
getLeftValue().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case StatementPackage.INPUT_COM_STATEMENT__LEFT_VALUE: | |
return leftValue != null && !leftValue.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //InputComStatementImpl |