/**
*/
package net.certware.evidence.hugin.netDSL.impl;
import net.certware.evidence.hugin.netDSL.ClassInstance;
import net.certware.evidence.hugin.netDSL.InputBindings;
import net.certware.evidence.hugin.netDSL.NetDSLPackage;
import net.certware.evidence.hugin.netDSL.NodeAttributes;
import net.certware.evidence.hugin.netDSL.OutputBindings;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Class Instance</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link net.certware.evidence.hugin.netDSL.impl.ClassInstanceImpl#getInstanceName <em>Instance Name</em>}</li>
* <li>{@link net.certware.evidence.hugin.netDSL.impl.ClassInstanceImpl#getClassName <em>Class Name</em>}</li>
* <li>{@link net.certware.evidence.hugin.netDSL.impl.ClassInstanceImpl#getInput <em>Input</em>}</li>
* <li>{@link net.certware.evidence.hugin.netDSL.impl.ClassInstanceImpl#getOutput <em>Output</em>}</li>
* <li>{@link net.certware.evidence.hugin.netDSL.impl.ClassInstanceImpl#getAttributes <em>Attributes</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ClassInstanceImpl extends ClassElementImpl implements ClassInstance
{
/**
* The default value of the '{@link #getInstanceName() <em>Instance Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInstanceName()
* @generated
* @ordered
*/
protected static final String INSTANCE_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getInstanceName() <em>Instance Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInstanceName()
* @generated
* @ordered
*/
protected String instanceName = INSTANCE_NAME_EDEFAULT;
/**
* The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassName()
* @generated
* @ordered
*/
protected static final String CLASS_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassName()
* @generated
* @ordered
*/
protected String className = CLASS_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getInput() <em>Input</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput()
* @generated
* @ordered
*/
protected InputBindings input;
/**
* The cached value of the '{@link #getOutput() <em>Output</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOutput()
* @generated
* @ordered
*/
protected OutputBindings output;
/**
* The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttributes()
* @generated
* @ordered
*/
protected NodeAttributes attributes;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ClassInstanceImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return NetDSLPackage.Literals.CLASS_INSTANCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getInstanceName()
{
return instanceName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInstanceName(String newInstanceName)
{
String oldInstanceName = instanceName;
instanceName = newInstanceName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__INSTANCE_NAME, oldInstanceName, instanceName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getClassName()
{
return className;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setClassName(String newClassName)
{
String oldClassName = className;
className = newClassName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__CLASS_NAME, oldClassName, className));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InputBindings getInput()
{
return input;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInput(InputBindings newInput, NotificationChain msgs)
{
InputBindings oldInput = input;
input = newInput;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__INPUT, oldInput, newInput);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput(InputBindings newInput)
{
if (newInput != input)
{
NotificationChain msgs = null;
if (input != null)
msgs = ((InternalEObject)input).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__INPUT, null, msgs);
if (newInput != null)
msgs = ((InternalEObject)newInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__INPUT, null, msgs);
msgs = basicSetInput(newInput, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__INPUT, newInput, newInput));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OutputBindings getOutput()
{
return output;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOutput(OutputBindings newOutput, NotificationChain msgs)
{
OutputBindings oldOutput = output;
output = newOutput;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__OUTPUT, oldOutput, newOutput);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOutput(OutputBindings newOutput)
{
if (newOutput != output)
{
NotificationChain msgs = null;
if (output != null)
msgs = ((InternalEObject)output).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__OUTPUT, null, msgs);
if (newOutput != null)
msgs = ((InternalEObject)newOutput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__OUTPUT, null, msgs);
msgs = basicSetOutput(newOutput, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__OUTPUT, newOutput, newOutput));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NodeAttributes getAttributes()
{
return attributes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAttributes(NodeAttributes newAttributes, NotificationChain msgs)
{
NodeAttributes oldAttributes = attributes;
attributes = newAttributes;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES, oldAttributes, newAttributes);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAttributes(NodeAttributes newAttributes)
{
if (newAttributes != attributes)
{
NotificationChain msgs = null;
if (attributes != null)
msgs = ((InternalEObject)attributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES, null, msgs);
if (newAttributes != null)
msgs = ((InternalEObject)newAttributes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES, null, msgs);
msgs = basicSetAttributes(newAttributes, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES, newAttributes, newAttributes));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case NetDSLPackage.CLASS_INSTANCE__INPUT:
return basicSetInput(null, msgs);
case NetDSLPackage.CLASS_INSTANCE__OUTPUT:
return basicSetOutput(null, msgs);
case NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES:
return basicSetAttributes(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 NetDSLPackage.CLASS_INSTANCE__INSTANCE_NAME:
return getInstanceName();
case NetDSLPackage.CLASS_INSTANCE__CLASS_NAME:
return getClassName();
case NetDSLPackage.CLASS_INSTANCE__INPUT:
return getInput();
case NetDSLPackage.CLASS_INSTANCE__OUTPUT:
return getOutput();
case NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES:
return getAttributes();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case NetDSLPackage.CLASS_INSTANCE__INSTANCE_NAME:
setInstanceName((String)newValue);
return;
case NetDSLPackage.CLASS_INSTANCE__CLASS_NAME:
setClassName((String)newValue);
return;
case NetDSLPackage.CLASS_INSTANCE__INPUT:
setInput((InputBindings)newValue);
return;
case NetDSLPackage.CLASS_INSTANCE__OUTPUT:
setOutput((OutputBindings)newValue);
return;
case NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES:
setAttributes((NodeAttributes)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case NetDSLPackage.CLASS_INSTANCE__INSTANCE_NAME:
setInstanceName(INSTANCE_NAME_EDEFAULT);
return;
case NetDSLPackage.CLASS_INSTANCE__CLASS_NAME:
setClassName(CLASS_NAME_EDEFAULT);
return;
case NetDSLPackage.CLASS_INSTANCE__INPUT:
setInput((InputBindings)null);
return;
case NetDSLPackage.CLASS_INSTANCE__OUTPUT:
setOutput((OutputBindings)null);
return;
case NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES:
setAttributes((NodeAttributes)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case NetDSLPackage.CLASS_INSTANCE__INSTANCE_NAME:
return INSTANCE_NAME_EDEFAULT == null ? instanceName != null : !INSTANCE_NAME_EDEFAULT.equals(instanceName);
case NetDSLPackage.CLASS_INSTANCE__CLASS_NAME:
return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
case NetDSLPackage.CLASS_INSTANCE__INPUT:
return input != null;
case NetDSLPackage.CLASS_INSTANCE__OUTPUT:
return output != null;
case NetDSLPackage.CLASS_INSTANCE__ATTRIBUTES:
return attributes != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (instanceName: ");
result.append(instanceName);
result.append(", className: ");
result.append(className);
result.append(')');
return result.toString();
}
} //ClassInstanceImpl