org.eclipse.ocl.expressions.impl.LoopExpImpl Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2006, 2008 IBM Corporation, Zeligsoft Inc., 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:
* IBM - Initial API and implementation
* Zeligsoft - Bug 207365
*
*
*
* $Id: LoopExpImpl.java,v 1.8 2008/10/12 01:09:49 cdamus Exp $
*/
package org.eclipse.ocl.expressions.impl;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.expressions.LoopExp;
import org.eclipse.ocl.expressions.OCLExpression;
import org.eclipse.ocl.expressions.Variable;
import org.eclipse.ocl.expressions.operations.LoopExpOperations;
/**
*
* An implementation of the model object 'Loop Exp'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.ocl.expressions.impl.LoopExpImpl#getBody Body}
* - {@link org.eclipse.ocl.expressions.impl.LoopExpImpl#getIterator Iterator}
*
*
*
* @generated
*/
public abstract class LoopExpImpl
extends CallExpImpl
implements LoopExp {
/**
* The cached value of the '{@link #getBody() Body}' containment reference.
*
*
* @see #getBody()
* @generated
* @ordered
*/
protected OCLExpression body;
/**
* The cached value of the '{@link #getIterator() Iterator}' containment reference list.
*
*
* @see #getIterator()
* @generated
* @ordered
*/
protected EList> iterator;
/**
*
*
* @generated
*/
protected LoopExpImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionsPackage.Literals.LOOP_EXP;
}
/**
*
*
* @generated
*/
public OCLExpression getBody() {
return body;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetBody(OCLExpression newBody,
NotificationChain msgs) {
OCLExpression oldBody = body;
body = newBody;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET, ExpressionsPackage.LOOP_EXP__BODY, oldBody,
newBody);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setBody(OCLExpression newBody) {
if (newBody != body) {
NotificationChain msgs = null;
if (body != null)
msgs = ((InternalEObject) body).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE - ExpressionsPackage.LOOP_EXP__BODY,
null, msgs);
if (newBody != null)
msgs = ((InternalEObject) newBody).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE - ExpressionsPackage.LOOP_EXP__BODY,
null, msgs);
msgs = basicSetBody(newBody, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
ExpressionsPackage.LOOP_EXP__BODY, newBody, newBody));
}
/**
*
*
* @generated
*/
public EList> getIterator() {
if (iterator == null) {
iterator = new EObjectContainmentEList>(
Variable.class, this, ExpressionsPackage.LOOP_EXP__ITERATOR);
}
return iterator;
}
/**
*
*
* @generated
*/
public boolean checkSourceCollection(DiagnosticChain diagnostics,
Map