blob: c78f708f3a74bd8138bf20ee4bcd0084b701ed35 [file] [log] [blame]
/**
* * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro
* * 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:
* * Istvan Rath, Daniel Varro - initial API and implementation
*
*/
package org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.modelmanagement.manipulationRules.deletion.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.viatra2.gtasmmodel.gtasm.metamodel.asm.simpleRules.impl.ModelManipulationRuleImpl;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.Term;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.modelmanagement.manipulationRules.deletion.DeletionPackage;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.modelmanagement.manipulationRules.deletion.RelationshipDeleteRule;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Relationship Delete Rule</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.modelmanagement.manipulationRules.deletion.impl.RelationshipDeleteRuleImpl#getSuper <em>Super</em>}</li>
* <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.modelmanagement.manipulationRules.deletion.impl.RelationshipDeleteRuleImpl#getSub <em>Sub</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class RelationshipDeleteRuleImpl extends ModelManipulationRuleImpl implements RelationshipDeleteRule
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = " * Copyright (c) 2006-2010 Istvan Rath and Daniel Varro\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors:\r\n * Istvan Rath, Daniel Varro - initial API and implementation\r\n";
/**
* The cached value of the '{@link #getSuper() <em>Super</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSuper()
* @generated
* @ordered
*/
protected Term super_;
/**
* The cached value of the '{@link #getSub() <em>Sub</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSub()
* @generated
* @ordered
*/
protected Term sub;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RelationshipDeleteRuleImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DeletionPackage.Literals.RELATIONSHIP_DELETE_RULE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Term getSuper()
{
return super_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSuper(Term newSuper, NotificationChain msgs)
{
Term oldSuper = super_;
super_ = newSuper;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER, oldSuper, newSuper);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSuper(Term newSuper)
{
if (newSuper != super_)
{
NotificationChain msgs = null;
if (super_ != null)
msgs = ((InternalEObject)super_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER, null, msgs);
if (newSuper != null)
msgs = ((InternalEObject)newSuper).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER, null, msgs);
msgs = basicSetSuper(newSuper, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER, newSuper, newSuper));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Term getSub()
{
return sub;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSub(Term newSub, NotificationChain msgs)
{
Term oldSub = sub;
sub = newSub;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB, oldSub, newSub);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSub(Term newSub)
{
if (newSub != sub)
{
NotificationChain msgs = null;
if (sub != null)
msgs = ((InternalEObject)sub).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB, null, msgs);
if (newSub != null)
msgs = ((InternalEObject)newSub).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB, null, msgs);
msgs = basicSetSub(newSub, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB, newSub, newSub));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER:
return basicSetSuper(null, msgs);
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB:
return basicSetSub(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 DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER:
return getSuper();
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB:
return getSub();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER:
setSuper((Term)newValue);
return;
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB:
setSub((Term)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER:
setSuper((Term)null);
return;
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB:
setSub((Term)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUPER:
return super_ != null;
case DeletionPackage.RELATIONSHIP_DELETE_RULE__SUB:
return sub != null;
}
return super.eIsSet(featureID);
}
} //RelationshipDeleteRuleImpl