/**
*
*
*
* $Id$
*/
package net.opengis.wcs11.impl;
import java.util.Collection;
import net.opengis.wcs11.GridCrsType;
import net.opengis.wcs11.ImageCRSRefType;
import net.opengis.wcs11.SpatialDomainType;
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.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Spatial Domain Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getBoundingBoxGroup Bounding Box Group}
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getBoundingBox Bounding Box}
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getGridCRS Grid CRS}
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getTransformation Transformation}
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getImageCRS Image CRS}
* - {@link net.opengis.wcs11.impl.SpatialDomainTypeImpl#getPolygon Polygon}
*
*
*
* @generated
*/
public class SpatialDomainTypeImpl extends EObjectImpl implements SpatialDomainType {
/**
* The cached value of the '{@link #getBoundingBoxGroup() Bounding Box Group}' attribute list.
*
*
* @see #getBoundingBoxGroup()
* @generated
* @ordered
*/
protected FeatureMap boundingBoxGroup;
/**
* The cached value of the '{@link #getGridCRS() Grid CRS}' containment reference.
*
*
* @see #getGridCRS()
* @generated
* @ordered
*/
protected GridCrsType gridCRS;
/**
* The default value of the '{@link #getTransformation() Transformation}' attribute.
*
*
* @see #getTransformation()
* @generated
* @ordered
*/
protected static final Object TRANSFORMATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getTransformation() Transformation}' attribute.
*
*
* @see #getTransformation()
* @generated
* @ordered
*/
protected Object transformation = TRANSFORMATION_EDEFAULT;
/**
* The cached value of the '{@link #getImageCRS() Image CRS}' containment reference.
*
*
* @see #getImageCRS()
* @generated
* @ordered
*/
protected ImageCRSRefType imageCRS;
/**
* The cached value of the '{@link #getPolygon() Polygon}' attribute list.
*
*
* @see #getPolygon()
* @generated
* @ordered
*/
protected EList polygon;
/**
*
*
* @generated
*/
protected SpatialDomainTypeImpl() {
super();
}
/**
*
*
* @generated
*/
protected EClass eStaticClass() {
return Wcs111Package.Literals.SPATIAL_DOMAIN_TYPE;
}
/**
*
*
* @generated
*/
public FeatureMap getBoundingBoxGroup() {
if (boundingBoxGroup == null) {
boundingBoxGroup = new BasicFeatureMap(this, Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP);
}
return boundingBoxGroup;
}
/**
*
*
* @generated
*/
public EList getBoundingBox() {
return getBoundingBoxGroup().list(Wcs111Package.Literals.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX);
}
/**
*
*
* @generated
*/
public GridCrsType getGridCRS() {
return gridCRS;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetGridCRS(GridCrsType newGridCRS, NotificationChain msgs) {
GridCrsType oldGridCRS = gridCRS;
gridCRS = newGridCRS;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS, oldGridCRS, newGridCRS);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setGridCRS(GridCrsType newGridCRS) {
if (newGridCRS != gridCRS) {
NotificationChain msgs = null;
if (gridCRS != null)
msgs = ((InternalEObject)gridCRS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS, null, msgs);
if (newGridCRS != null)
msgs = ((InternalEObject)newGridCRS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS, null, msgs);
msgs = basicSetGridCRS(newGridCRS, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS, newGridCRS, newGridCRS));
}
/**
*
*
* @generated
*/
public Object getTransformation() {
return transformation;
}
/**
*
*
* @generated
*/
public void setTransformation(Object newTransformation) {
Object oldTransformation = transformation;
transformation = newTransformation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.SPATIAL_DOMAIN_TYPE__TRANSFORMATION, oldTransformation, transformation));
}
/**
*
*
* @generated
*/
public ImageCRSRefType getImageCRS() {
return imageCRS;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetImageCRS(ImageCRSRefType newImageCRS, NotificationChain msgs) {
ImageCRSRefType oldImageCRS = imageCRS;
imageCRS = newImageCRS;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS, oldImageCRS, newImageCRS);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setImageCRS(ImageCRSRefType newImageCRS) {
if (newImageCRS != imageCRS) {
NotificationChain msgs = null;
if (imageCRS != null)
msgs = ((InternalEObject)imageCRS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS, null, msgs);
if (newImageCRS != null)
msgs = ((InternalEObject)newImageCRS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS, null, msgs);
msgs = basicSetImageCRS(newImageCRS, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS, newImageCRS, newImageCRS));
}
/**
*
*
* @generated
*/
public EList getPolygon() {
if (polygon == null) {
polygon = new EDataTypeEList(Object.class, this, Wcs111Package.SPATIAL_DOMAIN_TYPE__POLYGON);
}
return polygon;
}
/**
*
*
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP:
return ((InternalEList)getBoundingBoxGroup()).basicRemove(otherEnd, msgs);
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX:
return ((InternalEList)getBoundingBox()).basicRemove(otherEnd, msgs);
case Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS:
return basicSetGridCRS(null, msgs);
case Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS:
return basicSetImageCRS(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP:
if (coreType) return getBoundingBoxGroup();
return ((FeatureMap.Internal)getBoundingBoxGroup()).getWrapper();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX:
return getBoundingBox();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS:
return getGridCRS();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__TRANSFORMATION:
return getTransformation();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS:
return getImageCRS();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__POLYGON:
return getPolygon();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP:
((FeatureMap.Internal)getBoundingBoxGroup()).set(newValue);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX:
getBoundingBox().clear();
getBoundingBox().addAll((Collection)newValue);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS:
setGridCRS((GridCrsType)newValue);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__TRANSFORMATION:
setTransformation(newValue);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS:
setImageCRS((ImageCRSRefType)newValue);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__POLYGON:
getPolygon().clear();
getPolygon().addAll((Collection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP:
getBoundingBoxGroup().clear();
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX:
getBoundingBox().clear();
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS:
setGridCRS((GridCrsType)null);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__TRANSFORMATION:
setTransformation(TRANSFORMATION_EDEFAULT);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS:
setImageCRS((ImageCRSRefType)null);
return;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__POLYGON:
getPolygon().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX_GROUP:
return boundingBoxGroup != null && !boundingBoxGroup.isEmpty();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__BOUNDING_BOX:
return !getBoundingBox().isEmpty();
case Wcs111Package.SPATIAL_DOMAIN_TYPE__GRID_CRS:
return gridCRS != null;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__TRANSFORMATION:
return TRANSFORMATION_EDEFAULT == null ? transformation != null : !TRANSFORMATION_EDEFAULT.equals(transformation);
case Wcs111Package.SPATIAL_DOMAIN_TYPE__IMAGE_CRS:
return imageCRS != null;
case Wcs111Package.SPATIAL_DOMAIN_TYPE__POLYGON:
return polygon != null && !polygon.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (boundingBoxGroup: ");
result.append(boundingBoxGroup);
result.append(", transformation: ");
result.append(transformation);
result.append(", polygon: ");
result.append(polygon);
result.append(')');
return result.toString();
}
} //SpatialDomainTypeImpl