blob: 80baf2c0431f1d16af66b4e70b53fa06e1d986e7 [file] [log] [blame]
/**
*/
package org.eclipse.qvto.examples.xtext.imperativeoclcs.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.ocl.xtext.basecs.util.BaseCSVisitor;
import org.eclipse.qvto.examples.xtext.imperativeoclcs.ImperativeOCLCSPackage;
import org.eclipse.qvto.examples.xtext.imperativeoclcs.VarDeclarationCS;
import org.eclipse.qvto.examples.xtext.imperativeoclcs.VarsInitializationCS;
import org.eclipse.qvto.examples.xtext.imperativeoclcs.util.ImperativeOCLCSVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Vars Initialization CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvto.examples.xtext.imperativeoclcs.impl.VarsInitializationCSImpl#getOwnedVarDeclarations <em>Owned Var Declarations</em>}</li>
* </ul>
*
* @generated
*/
public class VarsInitializationCSImpl extends StatementCSImpl implements VarsInitializationCS {
/**
* The cached value of the '{@link #getOwnedVarDeclarations() <em>Owned Var Declarations</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedVarDeclarations()
* @generated
* @ordered
*/
protected EList<VarDeclarationCS> ownedVarDeclarations;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected VarsInitializationCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ImperativeOCLCSPackage.Literals.VARS_INITIALIZATION_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<VarDeclarationCS> getOwnedVarDeclarations() {
if (ownedVarDeclarations == null) {
ownedVarDeclarations = new EObjectContainmentEList<VarDeclarationCS>(VarDeclarationCS.class, this, ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS);
}
return ownedVarDeclarations;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS:
return ((InternalEList<?>)getOwnedVarDeclarations()).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 ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS:
return getOwnedVarDeclarations();
}
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 ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS:
getOwnedVarDeclarations().clear();
getOwnedVarDeclarations().addAll((Collection<? extends VarDeclarationCS>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS:
getOwnedVarDeclarations().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ImperativeOCLCSPackage.VARS_INITIALIZATION_CS__OWNED_VAR_DECLARATIONS:
return ownedVarDeclarations != null && !ownedVarDeclarations.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* {@inheritDoc}
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public <R> R accept(BaseCSVisitor<R> visitor) {
return (R) ((ImperativeOCLCSVisitor<?>)visitor).visitVarsInitializationCS(this);
}
} //VarsInitializationCSImpl