blob: 3b8fb94c15a752f880f1efb9aea9b7596f3f347d [file] [log] [blame]
/**
* Copyright (c) 2017 CEA.
* 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:
* CEA - initial API and implementation and/or initial documentation
*/
/**
* generated by Xtext 2.9.1
*/
package org.eclipse.sensinact.studio.language.sensinact.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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.sensinact.studio.language.sensinact.DSL_Expression;
import org.eclipse.sensinact.studio.language.sensinact.DSL_ListParam;
import org.eclipse.sensinact.studio.language.sensinact.SensinactPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>DSL List Param</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.sensinact.studio.language.sensinact.impl.DSL_ListParamImpl#getParam <em>Param</em>}</li>
* </ul>
*
* @generated
*/
public class DSL_ListParamImpl extends MinimalEObjectImpl.Container implements DSL_ListParam
{
/**
* The cached value of the '{@link #getParam() <em>Param</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParam()
* @generated
* @ordered
*/
protected EList<DSL_Expression> param;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DSL_ListParamImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SensinactPackage.Literals.DSL_LIST_PARAM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<DSL_Expression> getParam()
{
if (param == null)
{
param = new EObjectContainmentEList<DSL_Expression>(DSL_Expression.class, this, SensinactPackage.DSL_LIST_PARAM__PARAM);
}
return param;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SensinactPackage.DSL_LIST_PARAM__PARAM:
return ((InternalEList<?>)getParam()).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 SensinactPackage.DSL_LIST_PARAM__PARAM:
return getParam();
}
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 SensinactPackage.DSL_LIST_PARAM__PARAM:
getParam().clear();
getParam().addAll((Collection<? extends DSL_Expression>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SensinactPackage.DSL_LIST_PARAM__PARAM:
getParam().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SensinactPackage.DSL_LIST_PARAM__PARAM:
return param != null && !param.isEmpty();
}
return super.eIsSet(featureID);
}
} //DSL_ListParamImpl