/**
*
*
*
* $Id$
*/
package net.opengis.wcs11.impl;
import java.util.Collection;
import net.opengis.ows11.CodeType;
import net.opengis.ows11.UnNamedDomainType;
import net.opengis.ows11.impl.DescriptionTypeImpl;
import net.opengis.wcs11.AxisType;
import net.opengis.wcs11.FieldType;
import net.opengis.wcs11.InterpolationMethodsType;
import net.opengis.wcs11.Wcs111Package;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Field Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.wcs11.impl.FieldTypeImpl#getIdentifier Identifier}
* - {@link net.opengis.wcs11.impl.FieldTypeImpl#getDefinition Definition}
* - {@link net.opengis.wcs11.impl.FieldTypeImpl#getNullValue Null Value}
* - {@link net.opengis.wcs11.impl.FieldTypeImpl#getInterpolationMethods Interpolation Methods}
* - {@link net.opengis.wcs11.impl.FieldTypeImpl#getAxis Axis}
*
*
*
* @generated
*/
public class FieldTypeImpl extends DescriptionTypeImpl implements FieldType {
/**
* The default value of the '{@link #getIdentifier() Identifier}' attribute.
*
*
* @see #getIdentifier()
* @generated
* @ordered
*/
protected static final String IDENTIFIER_EDEFAULT = null;
/**
* The cached value of the '{@link #getIdentifier() Identifier}' attribute.
*
*
* @see #getIdentifier()
* @generated
* @ordered
*/
protected String identifier = IDENTIFIER_EDEFAULT;
/**
* The cached value of the '{@link #getDefinition() Definition}' containment reference.
*
*
* @see #getDefinition()
* @generated
* @ordered
*/
protected UnNamedDomainType definition;
/**
* The cached value of the '{@link #getNullValue() Null Value}' containment reference list.
*
*
* @see #getNullValue()
* @generated
* @ordered
*/
protected EList nullValue;
/**
* The cached value of the '{@link #getInterpolationMethods() Interpolation Methods}' containment reference.
*
*
* @see #getInterpolationMethods()
* @generated
* @ordered
*/
protected InterpolationMethodsType interpolationMethods;
/**
* The cached value of the '{@link #getAxis() Axis}' containment reference list.
*
*
* @see #getAxis()
* @generated
* @ordered
*/
protected EList axis;
/**
*
*
* @generated
*/
protected FieldTypeImpl() {
super();
}
/**
*
*
* @generated
*/
protected EClass eStaticClass() {
return Wcs111Package.Literals.FIELD_TYPE;
}
/**
*
*
* @generated
*/
public String getIdentifier() {
return identifier;
}
/**
*
*
* @generated
*/
public void setIdentifier(String newIdentifier) {
String oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.FIELD_TYPE__IDENTIFIER, oldIdentifier, identifier));
}
/**
*
*
* @generated
*/
public UnNamedDomainType getDefinition() {
return definition;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDefinition(UnNamedDomainType newDefinition, NotificationChain msgs) {
UnNamedDomainType oldDefinition = definition;
definition = newDefinition;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.FIELD_TYPE__DEFINITION, oldDefinition, newDefinition);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setDefinition(UnNamedDomainType newDefinition) {
if (newDefinition != definition) {
NotificationChain msgs = null;
if (definition != null)
msgs = ((InternalEObject)definition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.FIELD_TYPE__DEFINITION, null, msgs);
if (newDefinition != null)
msgs = ((InternalEObject)newDefinition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.FIELD_TYPE__DEFINITION, null, msgs);
msgs = basicSetDefinition(newDefinition, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.FIELD_TYPE__DEFINITION, newDefinition, newDefinition));
}
/**
*
*
* @generated
*/
public EList getNullValue() {
if (nullValue == null) {
nullValue = new EObjectContainmentEList(CodeType.class, this, Wcs111Package.FIELD_TYPE__NULL_VALUE);
}
return nullValue;
}
/**
*
*
* @generated
*/
public InterpolationMethodsType getInterpolationMethods() {
return interpolationMethods;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetInterpolationMethods(InterpolationMethodsType newInterpolationMethods, NotificationChain msgs) {
InterpolationMethodsType oldInterpolationMethods = interpolationMethods;
interpolationMethods = newInterpolationMethods;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS, oldInterpolationMethods, newInterpolationMethods);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setInterpolationMethods(InterpolationMethodsType newInterpolationMethods) {
if (newInterpolationMethods != interpolationMethods) {
NotificationChain msgs = null;
if (interpolationMethods != null)
msgs = ((InternalEObject)interpolationMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS, null, msgs);
if (newInterpolationMethods != null)
msgs = ((InternalEObject)newInterpolationMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS, null, msgs);
msgs = basicSetInterpolationMethods(newInterpolationMethods, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS, newInterpolationMethods, newInterpolationMethods));
}
/**
*
*
* @generated
*/
public EList getAxis() {
if (axis == null) {
axis = new EObjectContainmentEList(AxisType.class, this, Wcs111Package.FIELD_TYPE__AXIS);
}
return axis;
}
/**
*
*
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Wcs111Package.FIELD_TYPE__DEFINITION:
return basicSetDefinition(null, msgs);
case Wcs111Package.FIELD_TYPE__NULL_VALUE:
return ((InternalEList)getNullValue()).basicRemove(otherEnd, msgs);
case Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS:
return basicSetInterpolationMethods(null, msgs);
case Wcs111Package.FIELD_TYPE__AXIS:
return ((InternalEList)getAxis()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Wcs111Package.FIELD_TYPE__IDENTIFIER:
return getIdentifier();
case Wcs111Package.FIELD_TYPE__DEFINITION:
return getDefinition();
case Wcs111Package.FIELD_TYPE__NULL_VALUE:
return getNullValue();
case Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS:
return getInterpolationMethods();
case Wcs111Package.FIELD_TYPE__AXIS:
return getAxis();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Wcs111Package.FIELD_TYPE__IDENTIFIER:
setIdentifier((String)newValue);
return;
case Wcs111Package.FIELD_TYPE__DEFINITION:
setDefinition((UnNamedDomainType)newValue);
return;
case Wcs111Package.FIELD_TYPE__NULL_VALUE:
getNullValue().clear();
getNullValue().addAll((Collection)newValue);
return;
case Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS:
setInterpolationMethods((InterpolationMethodsType)newValue);
return;
case Wcs111Package.FIELD_TYPE__AXIS:
getAxis().clear();
getAxis().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case Wcs111Package.FIELD_TYPE__IDENTIFIER:
setIdentifier(IDENTIFIER_EDEFAULT);
return;
case Wcs111Package.FIELD_TYPE__DEFINITION:
setDefinition((UnNamedDomainType)null);
return;
case Wcs111Package.FIELD_TYPE__NULL_VALUE:
getNullValue().clear();
return;
case Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS:
setInterpolationMethods((InterpolationMethodsType)null);
return;
case Wcs111Package.FIELD_TYPE__AXIS:
getAxis().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case Wcs111Package.FIELD_TYPE__IDENTIFIER:
return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier);
case Wcs111Package.FIELD_TYPE__DEFINITION:
return definition != null;
case Wcs111Package.FIELD_TYPE__NULL_VALUE:
return nullValue != null && !nullValue.isEmpty();
case Wcs111Package.FIELD_TYPE__INTERPOLATION_METHODS:
return interpolationMethods != null;
case Wcs111Package.FIELD_TYPE__AXIS:
return axis != null && !axis.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (identifier: ");
result.append(identifier);
result.append(')');
return result.toString();
}
} //FieldTypeImpl