blob: 4ea9421abf6cefdef9cd43d01bc5e470f0778339 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014, 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.pivot.qvtimperative.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.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.util.Visitor;
import org.eclipse.qvtd.pivot.qvtimperative.MappingSequence;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
import org.eclipse.qvtd.pivot.qvtimperative.util.QVTimperativeVisitor;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Mapping Sequence</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.qvtd.pivot.qvtimperative.impl.MappingSequenceImpl#getMappingStatements <em>Mapping Statements</em>}</li>
* </ul>
*
* @generated
*/
public class MappingSequenceImpl extends MappingStatementImpl implements MappingSequence {
/**
* The cached value of the '{@link #getMappingStatements() <em>Mapping Statements</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMappingStatements()
* @generated
* @ordered
*/
protected EList<MappingStatement> mappingStatements;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MappingSequenceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QVTimperativePackage.Literals.MAPPING_SEQUENCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<MappingStatement> getMappingStatements() {
if (mappingStatements == null) {
mappingStatements = new EObjectContainmentEList<MappingStatement>(MappingStatement.class, this, QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS);
}
return mappingStatements;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS:
return ((InternalEList<?>)getMappingStatements()).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 QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS:
return getMappingStatements();
}
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 QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS:
getMappingStatements().clear();
getMappingStatements().addAll((Collection<? extends MappingStatement>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS:
getMappingStatements().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QVTimperativePackage.MAPPING_SEQUENCE__MAPPING_STATEMENTS:
return mappingStatements != null && !mappingStatements.isEmpty();
}
return super.eIsSet(featureID);
}
/**
* {@inheritDoc}
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public @Nullable <R> R accept(@NonNull Visitor<R> visitor) {
return (R) ((QVTimperativeVisitor<?>)visitor).visitMappingSequence(this);
}
} //MappingSequenceImpl