/** | |
* ******************************************************************************* | |
* Copyright (c) 2009 Mia-Software. | |
* 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: | |
* | |
* Fabien Giquel (Mia-Software) - initial API and implementation | |
* ******************************************************************************* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.java.emf.classic.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.gmt.modisco.java.ContinueStatement; | |
import org.eclipse.gmt.modisco.java.LabeledStatement; | |
import org.eclipse.gmt.modisco.java.emf.classic.JavaPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Continue Statement</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.gmt.modisco.java.emf.classic.impl.ContinueStatementImpl#getLabel <em>Label</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class ContinueStatementImpl extends StatementImpl implements ContinueStatement { | |
/** | |
* The cached value of the '{@link #getLabel() <em>Label</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getLabel() | |
* @generated | |
* @ordered | |
*/ | |
protected LabeledStatement label; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ContinueStatementImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return JavaPackage.eINSTANCE.getContinueStatement(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public LabeledStatement getLabel() { | |
if (label != null && label.eIsProxy()) { | |
InternalEObject oldLabel = (InternalEObject)label; | |
label = (LabeledStatement)eResolveProxy(oldLabel); | |
if (label != oldLabel) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, JavaPackage.CONTINUE_STATEMENT__LABEL, oldLabel, label)); | |
} | |
} | |
return label; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public LabeledStatement basicGetLabel() { | |
return label; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetLabel(LabeledStatement newLabel, NotificationChain msgs) { | |
LabeledStatement oldLabel = label; | |
label = newLabel; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JavaPackage.CONTINUE_STATEMENT__LABEL, oldLabel, newLabel); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setLabel(LabeledStatement newLabel) { | |
if (newLabel != label) { | |
NotificationChain msgs = null; | |
if (label != null) | |
msgs = ((InternalEObject)label).eInverseRemove(this, JavaPackage.LABELED_STATEMENT__USAGES_IN_CONTINUE_STATEMENTS, LabeledStatement.class, msgs); | |
if (newLabel != null) | |
msgs = ((InternalEObject)newLabel).eInverseAdd(this, JavaPackage.LABELED_STATEMENT__USAGES_IN_CONTINUE_STATEMENTS, LabeledStatement.class, msgs); | |
msgs = basicSetLabel(newLabel, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, JavaPackage.CONTINUE_STATEMENT__LABEL, newLabel, newLabel)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case JavaPackage.CONTINUE_STATEMENT__LABEL: | |
if (label != null) | |
msgs = ((InternalEObject)label).eInverseRemove(this, JavaPackage.LABELED_STATEMENT__USAGES_IN_CONTINUE_STATEMENTS, LabeledStatement.class, msgs); | |
return basicSetLabel((LabeledStatement)otherEnd, msgs); | |
} | |
return super.eInverseAdd(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case JavaPackage.CONTINUE_STATEMENT__LABEL: | |
return basicSetLabel(null, 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 JavaPackage.CONTINUE_STATEMENT__LABEL: | |
if (resolve) return getLabel(); | |
return basicGetLabel(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case JavaPackage.CONTINUE_STATEMENT__LABEL: | |
setLabel((LabeledStatement)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case JavaPackage.CONTINUE_STATEMENT__LABEL: | |
setLabel((LabeledStatement)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case JavaPackage.CONTINUE_STATEMENT__LABEL: | |
return label != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //ContinueStatementImpl |