/**
* <copyright>
* Copyright (c) 2010-2014 Henshin developers. 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
* </copyright>
*/
package org.eclipse.emf.henshin.model.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.emf.henshin.model.Formula;
import org.eclipse.emf.henshin.model.HenshinPackage;
import org.eclipse.emf.henshin.model.UnaryFormula;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Unary Formula</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.henshin.model.impl.UnaryFormulaImpl#getChild <em>Child</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class UnaryFormulaImpl extends ModelElementImpl implements UnaryFormula {
/**
* The cached value of the '{@link #getChild() <em>Child</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getChild()
* @generated
* @ordered
*/
protected Formula child;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UnaryFormulaImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return HenshinPackage.Literals.UNARY_FORMULA;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Formula getChild() {
return child;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetChild(Formula newChild, NotificationChain msgs) {
Formula oldChild = child;
child = newChild;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, HenshinPackage.UNARY_FORMULA__CHILD, oldChild, newChild);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setChild(Formula newChild) {
if (newChild != child) {
NotificationChain msgs = null;
if (child != null)
msgs = ((InternalEObject)child).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - HenshinPackage.UNARY_FORMULA__CHILD, null, msgs);
if (newChild != null)
msgs = ((InternalEObject)newChild).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - HenshinPackage.UNARY_FORMULA__CHILD, null, msgs);
msgs = basicSetChild(newChild, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, HenshinPackage.UNARY_FORMULA__CHILD, newChild, newChild));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public abstract boolean isTrue();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public abstract boolean isFalse();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case HenshinPackage.UNARY_FORMULA__CHILD:
return basicSetChild(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 HenshinPackage.UNARY_FORMULA__CHILD:
return getChild();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case HenshinPackage.UNARY_FORMULA__CHILD:
setChild((Formula)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case HenshinPackage.UNARY_FORMULA__CHILD:
setChild((Formula)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case HenshinPackage.UNARY_FORMULA__CHILD:
return child != null;
}
return super.eIsSet(featureID);
}
} //UnaryFormulaImpl