blob: 2553f9e71102626875e40b41689cceea2325bea8 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015, 2021 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.acceleo.query.ast.impl;
import java.util.Collection;
import org.eclipse.acceleo.query.ast.AstPackage;
import org.eclipse.acceleo.query.ast.Expression;
import org.eclipse.acceleo.query.ast.SequenceInExtensionLiteral;
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>Sequence In Extension</b></em>'. <!--
* end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.acceleo.query.ast.impl.SequenceInExtensionLiteralImpl#getValues
* <em>Values</em>}</li>
* </ul>
*
* @generated
*/
public class SequenceInExtensionLiteralImpl extends LiteralImpl implements SequenceInExtensionLiteral {
/**
* The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #getValues()
* @generated
* @ordered
*/
protected EList<Expression> values;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected SequenceInExtensionLiteralImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return AstPackage.Literals.SEQUENCE_IN_EXTENSION_LITERAL;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<Expression> getValues() {
if (values == null) {
values = new EObjectContainmentEList<Expression>(Expression.class, this,
AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES);
}
return values;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES:
return ((InternalEList<?>)getValues()).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 AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES:
return getValues();
}
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 AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES:
getValues().clear();
getValues().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 AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES:
getValues().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AstPackage.SEQUENCE_IN_EXTENSION_LITERAL__VALUES:
return values != null && !values.isEmpty();
}
return super.eIsSet(featureID);
}
} // SequenceInExtensionImpl