blob: cc038b23829b1db8664983db53b955f9367019cf [file] [log] [blame]
/**
* <copyright>
* </copyright>
*
*/
package org.eclipse.e4.cSS.impl;
import org.eclipse.e4.cSS.CSSPackage;
import org.eclipse.e4.cSS.function;
import org.eclipse.e4.cSS.pseudo;
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.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>pseudo</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.e4.cSS.impl.pseudoImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.e4.cSS.impl.pseudoImpl#getFunction <em>Function</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class pseudoImpl extends MinimalEObjectImpl.Container implements pseudo
{
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getFunction() <em>Function</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFunction()
* @generated
* @ordered
*/
protected function function;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected pseudoImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return CSSPackage.Literals.PSEUDO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CSSPackage.PSEUDO__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public function getFunction()
{
return function;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFunction(function newFunction, NotificationChain msgs)
{
function oldFunction = function;
function = newFunction;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CSSPackage.PSEUDO__FUNCTION, oldFunction, newFunction);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFunction(function newFunction)
{
if (newFunction != function)
{
NotificationChain msgs = null;
if (function != null)
msgs = ((InternalEObject)function).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CSSPackage.PSEUDO__FUNCTION, null, msgs);
if (newFunction != null)
msgs = ((InternalEObject)newFunction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CSSPackage.PSEUDO__FUNCTION, null, msgs);
msgs = basicSetFunction(newFunction, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CSSPackage.PSEUDO__FUNCTION, newFunction, newFunction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case CSSPackage.PSEUDO__FUNCTION:
return basicSetFunction(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 CSSPackage.PSEUDO__NAME:
return getName();
case CSSPackage.PSEUDO__FUNCTION:
return getFunction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case CSSPackage.PSEUDO__NAME:
setName((String)newValue);
return;
case CSSPackage.PSEUDO__FUNCTION:
setFunction((function)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case CSSPackage.PSEUDO__NAME:
setName(NAME_EDEFAULT);
return;
case CSSPackage.PSEUDO__FUNCTION:
setFunction((function)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case CSSPackage.PSEUDO__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case CSSPackage.PSEUDO__FUNCTION:
return function != 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(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //pseudoImpl