blob: 444f86d67121b599e102ae7b8293bd0abdd6edcb [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2012, 2015 Willink Transformations 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
*
* Contributors:
* E.D.Willink - initial API and implementation
*******************************************************************************/
package org.eclipse.qvtd.xtext.qvtcorebasecs.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.impl.ModelElementCSImpl;
import org.eclipse.qvtd.xtext.qvtcorebasecs.PatternCS;
import org.eclipse.qvtd.xtext.qvtcorebasecs.QVTcoreBaseCSPackage;
import org.eclipse.qvtd.xtext.qvtcorebasecs.UnrealizedVariableCS;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Pattern CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.xtext.qvtcorebasecs.impl.PatternCSImpl#getOwnedUnrealizedVariables <em>Owned Unrealized Variables</em>}</li>
* </ul>
*
* @generated
*/
public abstract class PatternCSImpl extends ModelElementCSImpl implements PatternCS {
/**
* The cached value of the '{@link #getOwnedUnrealizedVariables() <em>Owned Unrealized Variables</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedUnrealizedVariables()
* @generated
* @ordered
*/
protected EList<UnrealizedVariableCS> ownedUnrealizedVariables;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PatternCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTcoreBaseCSPackage.Literals.PATTERN_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<UnrealizedVariableCS> getOwnedUnrealizedVariables() {
if (ownedUnrealizedVariables == null) {
ownedUnrealizedVariables = new EObjectContainmentEList<UnrealizedVariableCS>(UnrealizedVariableCS.class, this, QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES);
}
return ownedUnrealizedVariables;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES:
return ((InternalEList<?>)getOwnedUnrealizedVariables()).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 QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES:
return getOwnedUnrealizedVariables();
}
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 QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES:
getOwnedUnrealizedVariables().clear();
getOwnedUnrealizedVariables().addAll((Collection<? extends UnrealizedVariableCS>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES:
getOwnedUnrealizedVariables().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTcoreBaseCSPackage.PATTERN_CS__OWNED_UNREALIZED_VARIABLES:
return ownedUnrealizedVariables != null && !ownedUnrealizedVariables.isEmpty();
}
return super.eIsSet(featureID);
}
} //PatternCSImpl