org.eclipse.ocl.cst.impl.CollectionRangeCSImpl Maven / Gradle / Ivy
/**
*
*
* Copyright (c) 2005, 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 243976
*
*
*
* $Id: CollectionRangeCSImpl.java,v 1.3 2008/11/30 22:11:37 cdamus Exp $
*/
package org.eclipse.ocl.cst.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.ocl.cst.CSTPackage;
import org.eclipse.ocl.cst.CollectionRangeCS;
import org.eclipse.ocl.cst.OCLExpressionCS;
/**
*
* An implementation of the model object 'Collection Range CS'.
*
*
* The following features are implemented:
*
* - {@link org.eclipse.ocl.cst.impl.CollectionRangeCSImpl#getLastExpressionCS Last Expression CS}
*
*
*
* @generated
*/
public class CollectionRangeCSImpl
extends CollectionLiteralPartCSImpl
implements CollectionRangeCS {
/**
* The cached value of the '{@link #getLastExpressionCS() Last Expression CS}' containment reference.
*
*
* @see #getLastExpressionCS()
* @generated
* @ordered
*/
protected OCLExpressionCS lastExpressionCS;
/**
*
*
* @generated
*/
protected CollectionRangeCSImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CSTPackage.Literals.COLLECTION_RANGE_CS;
}
/**
*
*
* @generated
*/
public OCLExpressionCS getLastExpressionCS() {
return lastExpressionCS;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetLastExpressionCS(
OCLExpressionCS newLastExpressionCS, NotificationChain msgs) {
OCLExpressionCS oldLastExpressionCS = lastExpressionCS;
lastExpressionCS = newLastExpressionCS;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET,
CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS,
oldLastExpressionCS, newLastExpressionCS);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setLastExpressionCS(OCLExpressionCS newLastExpressionCS) {
if (newLastExpressionCS != lastExpressionCS) {
NotificationChain msgs = null;
if (lastExpressionCS != null)
msgs = ((InternalEObject) lastExpressionCS).eInverseRemove(
this, EOPPOSITE_FEATURE_BASE
- CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS,
null, msgs);
if (newLastExpressionCS != null)
msgs = ((InternalEObject) newLastExpressionCS).eInverseAdd(
this, EOPPOSITE_FEATURE_BASE
- CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS,
null, msgs);
msgs = basicSetLastExpressionCS(newLastExpressionCS, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS,
newLastExpressionCS, newLastExpressionCS));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS :
return basicSetLastExpressionCS(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS :
return getLastExpressionCS();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS :
setLastExpressionCS((OCLExpressionCS) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS :
setLastExpressionCS((OCLExpressionCS) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CSTPackage.COLLECTION_RANGE_CS__LAST_EXPRESSION_CS :
return lastExpressionCS != null;
}
return super.eIsSet(featureID);
}
} //CollectionRangeCSImpl