blob: d24f37aeb2f963f6d825fa2918fe35424112c2b8 [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.asm.simpleRules.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.PrintLnRule;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.simpleRules.SimpleRulesPackage;
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.terms.Term;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Print Ln Rule</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.simpleRules.impl.PrintLnRuleImpl#getOut <em>Out</em>}</li>
* <li>{@link org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.simpleRules.impl.PrintLnRuleImpl#getBuffer <em>Buffer</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PrintLnRuleImpl extends ASMRuleInvocationImpl implements PrintLnRule
{
/**
* <!-- 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 #getOut() <em>Out</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOut()
* @generated
* @ordered
*/
protected Term out;
/**
* The cached value of the '{@link #getBuffer() <em>Buffer</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBuffer()
* @generated
* @ordered
*/
protected Term buffer;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PrintLnRuleImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return SimpleRulesPackage.Literals.PRINT_LN_RULE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Term getOut()
{
return out;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOut(Term newOut, NotificationChain msgs)
{
Term oldOut = out;
out = newOut;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleRulesPackage.PRINT_LN_RULE__OUT, oldOut, newOut);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOut(Term newOut)
{
if (newOut != out)
{
NotificationChain msgs = null;
if (out != null)
msgs = ((InternalEObject)out).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SimpleRulesPackage.PRINT_LN_RULE__OUT, null, msgs);
if (newOut != null)
msgs = ((InternalEObject)newOut).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SimpleRulesPackage.PRINT_LN_RULE__OUT, null, msgs);
msgs = basicSetOut(newOut, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SimpleRulesPackage.PRINT_LN_RULE__OUT, newOut, newOut));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Term getBuffer()
{
return buffer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBuffer(Term newBuffer, NotificationChain msgs)
{
Term oldBuffer = buffer;
buffer = newBuffer;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SimpleRulesPackage.PRINT_LN_RULE__BUFFER, oldBuffer, newBuffer);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBuffer(Term newBuffer)
{
if (newBuffer != buffer)
{
NotificationChain msgs = null;
if (buffer != null)
msgs = ((InternalEObject)buffer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SimpleRulesPackage.PRINT_LN_RULE__BUFFER, null, msgs);
if (newBuffer != null)
msgs = ((InternalEObject)newBuffer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SimpleRulesPackage.PRINT_LN_RULE__BUFFER, null, msgs);
msgs = basicSetBuffer(newBuffer, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SimpleRulesPackage.PRINT_LN_RULE__BUFFER, newBuffer, newBuffer));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case SimpleRulesPackage.PRINT_LN_RULE__OUT:
return basicSetOut(null, msgs);
case SimpleRulesPackage.PRINT_LN_RULE__BUFFER:
return basicSetBuffer(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 SimpleRulesPackage.PRINT_LN_RULE__OUT:
return getOut();
case SimpleRulesPackage.PRINT_LN_RULE__BUFFER:
return getBuffer();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case SimpleRulesPackage.PRINT_LN_RULE__OUT:
setOut((Term)newValue);
return;
case SimpleRulesPackage.PRINT_LN_RULE__BUFFER:
setBuffer((Term)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case SimpleRulesPackage.PRINT_LN_RULE__OUT:
setOut((Term)null);
return;
case SimpleRulesPackage.PRINT_LN_RULE__BUFFER:
setBuffer((Term)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case SimpleRulesPackage.PRINT_LN_RULE__OUT:
return out != null;
case SimpleRulesPackage.PRINT_LN_RULE__BUFFER:
return buffer != null;
}
return super.eIsSet(featureID);
}
} //PrintLnRuleImpl