org.eclipse.xtext.xbase.impl.XBlockExpressionImpl Maven / Gradle / Ivy
/**
* Copyright (c) 2011 itemis AG (http://www.itemis.eu) 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
*/
package org.eclipse.xtext.xbase.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.xtext.xbase.XBlockExpression;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.XbasePackage;
/**
*
* An implementation of the model object 'XBlock Expression'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.xtext.xbase.impl.XBlockExpressionImpl#getExpressions Expressions}
*
*
* @generated
*/
public class XBlockExpressionImpl extends XExpressionImpl implements XBlockExpression
{
/**
* The cached value of the '{@link #getExpressions() Expressions}' containment reference list.
*
*
* @see #getExpressions()
* @generated
* @ordered
*/
protected EList expressions;
/**
*
*
* @generated
*/
protected XBlockExpressionImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return XbasePackage.Literals.XBLOCK_EXPRESSION;
}
/**
*
*
* @generated
*/
public EList getExpressions()
{
if (expressions == null)
{
expressions = new EObjectContainmentEList(XExpression.class, this, XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS);
}
return expressions;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
return ((InternalEList>)getExpressions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
return getExpressions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
getExpressions().clear();
getExpressions().addAll((Collection extends XExpression>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
getExpressions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case XbasePackage.XBLOCK_EXPRESSION__EXPRESSIONS:
return expressions != null && !expressions.isEmpty();
}
return super.eIsSet(featureID);
}
} //XBlockExpressionImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy