blob: 559c1850d0e571c5145c28b7fe7351e5fdae4e8d [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.qvtrelationcs.impl;
import java.util.Collection;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.Element;
import org.eclipse.ocl.xtext.basecs.impl.ModelElementCSImpl;
import org.eclipse.ocl.xtext.basecs.util.BaseCSVisitor;
import org.eclipse.qvtd.xtext.qvtrelationcs.QVTrelationCSPackage;
import org.eclipse.qvtd.xtext.qvtrelationcs.UnitCS;
import org.eclipse.qvtd.xtext.qvtrelationcs.util.QVTrelationCSVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Unit CS</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.xtext.qvtrelationcs.impl.UnitCSImpl#getIdentifiers <em>Identifiers</em>}</li>
* </ul>
*
* @generated
*/
public class UnitCSImpl extends ModelElementCSImpl implements UnitCS {
/**
* The cached value of the '{@link #getIdentifiers() <em>Identifiers</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifiers()
* @generated
* @ordered
*/
protected EList<Element> identifiers;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UnitCSImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTrelationCSPackage.Literals.UNIT_CS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<Element> getIdentifiers() {
if (identifiers == null) {
identifiers = new EObjectResolvingEList<Element>(Element.class, this, QVTrelationCSPackage.UNIT_CS__IDENTIFIERS);
}
return identifiers;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case QVTrelationCSPackage.UNIT_CS__IDENTIFIERS:
return getIdentifiers();
}
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 QVTrelationCSPackage.UNIT_CS__IDENTIFIERS:
getIdentifiers().clear();
getIdentifiers().addAll((Collection<? extends Element>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTrelationCSPackage.UNIT_CS__IDENTIFIERS:
getIdentifiers().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTrelationCSPackage.UNIT_CS__IDENTIFIERS:
return identifiers != null && !identifiers.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public @Nullable <R> R accept(@NonNull BaseCSVisitor<R> visitor) {
return (R) ((QVTrelationCSVisitor<?>)visitor).visitUnitCS(this);
}
} //UnitCSImpl