org.eclipse.ocl.expressions.impl.IterateExpImpl Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2006, 2009 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: IterateExpImpl.java,v 1.8 2009/01/23 17:16:03 cdamus Exp $
*/
package org.eclipse.ocl.expressions.impl;
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.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ocl.expressions.ExpressionsPackage;
import org.eclipse.ocl.expressions.IterateExp;
import org.eclipse.ocl.expressions.Variable;
import org.eclipse.ocl.expressions.operations.IterateExpOperations;
import org.eclipse.ocl.utilities.Visitor;
/**
*
* An implementation of the model object 'Iterate Exp'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.ocl.expressions.impl.IterateExpImpl#getResult Result}
*
*
*
* @generated
*/
public class IterateExpImpl
extends LoopExpImpl
implements IterateExp {
/**
* The cached value of the '{@link #getResult() Result}' containment reference.
*
*
* @see #getResult()
* @generated
* @ordered
*/
protected Variable result;
/**
*
*
* @generated
*/
protected IterateExpImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExpressionsPackage.Literals.ITERATE_EXP;
}
/**
*
*
* @generated
*/
public Variable getResult() {
return result;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetResult(Variable newResult,
NotificationChain msgs) {
Variable oldResult = result;
result = newResult;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET, ExpressionsPackage.ITERATE_EXP__RESULT,
oldResult, newResult);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setResult(Variable newResult) {
if (newResult != result) {
NotificationChain msgs = null;
if (result != null)
msgs = ((InternalEObject) result).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE
- ExpressionsPackage.ITERATE_EXP__RESULT, null, msgs);
if (newResult != null)
msgs = ((InternalEObject) newResult).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE
- ExpressionsPackage.ITERATE_EXP__RESULT, null, msgs);
msgs = basicSetResult(newResult, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
ExpressionsPackage.ITERATE_EXP__RESULT, newResult, newResult));
}
/**
*
*
* @generated
*/
public boolean checkIterateType(DiagnosticChain diagnostics,
Map