org.openxma.dsl.dom.model.impl.CollectionFunctionImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id$
*/
package org.openxma.dsl.dom.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.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.CollectionFunction;
import org.openxma.dsl.dom.model.PropertyValue;
/**
*
* An implementation of the model object 'Collection Function'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.CollectionFunctionImpl#getFunction Function}
* - {@link org.openxma.dsl.dom.model.impl.CollectionFunctionImpl#getProperty Property}
*
*
*
* @generated
*/
public class CollectionFunctionImpl extends ExpressionImpl implements CollectionFunction {
/**
* The default value of the '{@link #getFunction() Function}' attribute.
*
*
* @see #getFunction()
* @generated
* @ordered
*/
protected static final String FUNCTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getFunction() Function}' attribute.
*
*
* @see #getFunction()
* @generated
* @ordered
*/
protected String function = FUNCTION_EDEFAULT;
/**
* The cached value of the '{@link #getProperty() Property}' containment reference.
*
*
* @see #getProperty()
* @generated
* @ordered
*/
protected PropertyValue property;
/**
*
*
* @generated
*/
protected CollectionFunctionImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.COLLECTION_FUNCTION;
}
/**
*
*
* @generated
*/
public String getFunction() {
return function;
}
/**
*
*
* @generated
*/
public void setFunction(String newFunction) {
String oldFunction = function;
function = newFunction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.COLLECTION_FUNCTION__FUNCTION, oldFunction, function));
}
/**
*
*
* @generated
*/
public PropertyValue getProperty() {
return property;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetProperty(PropertyValue newProperty, NotificationChain msgs) {
PropertyValue oldProperty = property;
property = newProperty;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DomPackage.COLLECTION_FUNCTION__PROPERTY, oldProperty, newProperty);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setProperty(PropertyValue newProperty) {
if (newProperty != property) {
NotificationChain msgs = null;
if (property != null)
msgs = ((InternalEObject)property).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DomPackage.COLLECTION_FUNCTION__PROPERTY, null, msgs);
if (newProperty != null)
msgs = ((InternalEObject)newProperty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DomPackage.COLLECTION_FUNCTION__PROPERTY, null, msgs);
msgs = basicSetProperty(newProperty, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.COLLECTION_FUNCTION__PROPERTY, newProperty, newProperty));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.COLLECTION_FUNCTION__PROPERTY:
return basicSetProperty(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.COLLECTION_FUNCTION__FUNCTION:
return getFunction();
case DomPackage.COLLECTION_FUNCTION__PROPERTY:
return getProperty();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.COLLECTION_FUNCTION__FUNCTION:
setFunction((String)newValue);
return;
case DomPackage.COLLECTION_FUNCTION__PROPERTY:
setProperty((PropertyValue)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.COLLECTION_FUNCTION__FUNCTION:
setFunction(FUNCTION_EDEFAULT);
return;
case DomPackage.COLLECTION_FUNCTION__PROPERTY:
setProperty((PropertyValue)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.COLLECTION_FUNCTION__FUNCTION:
return FUNCTION_EDEFAULT == null ? function != null : !FUNCTION_EDEFAULT.equals(function);
case DomPackage.COLLECTION_FUNCTION__PROPERTY:
return property != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (function: ");
result.append(function);
result.append(')');
return result.toString();
}
} //CollectionFunctionImpl