/**
*
*
*
* $Id$
*/
package net.opengis.fes20.impl;
import net.opengis.fes20.Fes20Package;
import net.opengis.fes20.FunctionType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Function Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.fes20.impl.FunctionTypeImpl#getExpressionGroup Expression Group}
* - {@link net.opengis.fes20.impl.FunctionTypeImpl#getExpression Expression}
* - {@link net.opengis.fes20.impl.FunctionTypeImpl#getName Name}
*
*
*
* @generated
*/
public class FunctionTypeImpl extends EObjectImpl implements FunctionType {
/**
* The cached value of the '{@link #getExpressionGroup() Expression Group}' attribute list.
*
*
* @see #getExpressionGroup()
* @generated
* @ordered
*/
protected FeatureMap expressionGroup;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
*
*
* @generated
*/
protected FunctionTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Fes20Package.Literals.FUNCTION_TYPE;
}
/**
*
*
* @generated
*/
public FeatureMap getExpressionGroup() {
if (expressionGroup == null) {
expressionGroup = new BasicFeatureMap(this, Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP);
}
return expressionGroup;
}
/**
*
*
* @generated
*/
public EList getExpression() {
return getExpressionGroup().list(Fes20Package.Literals.FUNCTION_TYPE__EXPRESSION);
}
/**
*
*
* @generated
*/
public String getName() {
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Fes20Package.FUNCTION_TYPE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP:
return ((InternalEList>)getExpressionGroup()).basicRemove(otherEnd, msgs);
case Fes20Package.FUNCTION_TYPE__EXPRESSION:
return ((InternalEList>)getExpression()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP:
if (coreType) return getExpressionGroup();
return ((FeatureMap.Internal)getExpressionGroup()).getWrapper();
case Fes20Package.FUNCTION_TYPE__EXPRESSION:
return getExpression();
case Fes20Package.FUNCTION_TYPE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP:
((FeatureMap.Internal)getExpressionGroup()).set(newValue);
return;
case Fes20Package.FUNCTION_TYPE__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP:
getExpressionGroup().clear();
return;
case Fes20Package.FUNCTION_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Fes20Package.FUNCTION_TYPE__EXPRESSION_GROUP:
return expressionGroup != null && !expressionGroup.isEmpty();
case Fes20Package.FUNCTION_TYPE__EXPRESSION:
return !getExpression().isEmpty();
case Fes20Package.FUNCTION_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (expressionGroup: ");
result.append(expressionGroup);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //FunctionTypeImpl