/**
*
*
*
* $Id$
*/
package net.opengis.wfs20.impl;
import net.opengis.wfs20.AdditionalValuesType;
import net.opengis.wfs20.SimpleFeatureCollectionType;
import net.opengis.wfs20.ValueCollectionType;
import net.opengis.wfs20.Wfs20Package;
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.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 'Additional Values Type'.
*
*
* The following features are implemented:
*
* - {@link net.opengis.wfs20.impl.AdditionalValuesTypeImpl#getValueCollection Value Collection}
* - {@link net.opengis.wfs20.impl.AdditionalValuesTypeImpl#getSimpleFeatureCollectionGroup Simple Feature Collection Group}
* - {@link net.opengis.wfs20.impl.AdditionalValuesTypeImpl#getSimpleFeatureCollection Simple Feature Collection}
*
*
*
* @generated
*/
public class AdditionalValuesTypeImpl extends EObjectImpl implements AdditionalValuesType {
/**
* The cached value of the '{@link #getValueCollection() Value Collection}' containment reference.
*
*
* @see #getValueCollection()
* @generated
* @ordered
*/
protected ValueCollectionType valueCollection;
/**
* The cached value of the '{@link #getSimpleFeatureCollectionGroup() Simple Feature Collection Group}' attribute list.
*
*
* @see #getSimpleFeatureCollectionGroup()
* @generated
* @ordered
*/
protected FeatureMap simpleFeatureCollectionGroup;
/**
*
*
* @generated
*/
protected AdditionalValuesTypeImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Wfs20Package.Literals.ADDITIONAL_VALUES_TYPE;
}
/**
*
*
* @generated
*/
public ValueCollectionType getValueCollection() {
return valueCollection;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetValueCollection(ValueCollectionType newValueCollection, NotificationChain msgs) {
ValueCollectionType oldValueCollection = valueCollection;
valueCollection = newValueCollection;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION, oldValueCollection, newValueCollection);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setValueCollection(ValueCollectionType newValueCollection) {
if (newValueCollection != valueCollection) {
NotificationChain msgs = null;
if (valueCollection != null)
msgs = ((InternalEObject)valueCollection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION, null, msgs);
if (newValueCollection != null)
msgs = ((InternalEObject)newValueCollection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION, null, msgs);
msgs = basicSetValueCollection(newValueCollection, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION, newValueCollection, newValueCollection));
}
/**
*
*
* @generated
*/
public FeatureMap getSimpleFeatureCollectionGroup() {
if (simpleFeatureCollectionGroup == null) {
simpleFeatureCollectionGroup = new BasicFeatureMap(this, Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP);
}
return simpleFeatureCollectionGroup;
}
/**
*
*
* @generated
*/
public SimpleFeatureCollectionType getSimpleFeatureCollection() {
return (SimpleFeatureCollectionType)getSimpleFeatureCollectionGroup().get(Wfs20Package.Literals.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION, true);
}
/**
*
*
* @generated
*/
public NotificationChain basicSetSimpleFeatureCollection(SimpleFeatureCollectionType newSimpleFeatureCollection, NotificationChain msgs) {
return ((FeatureMap.Internal)getSimpleFeatureCollectionGroup()).basicAdd(Wfs20Package.Literals.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION, newSimpleFeatureCollection, msgs);
}
/**
*
*
* @generated
*/
public void setSimpleFeatureCollection(SimpleFeatureCollectionType newSimpleFeatureCollection) {
((FeatureMap.Internal)getSimpleFeatureCollectionGroup()).set(Wfs20Package.Literals.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION, newSimpleFeatureCollection);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION:
return basicSetValueCollection(null, msgs);
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP:
return ((InternalEList>)getSimpleFeatureCollectionGroup()).basicRemove(otherEnd, msgs);
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION:
return basicSetSimpleFeatureCollection(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION:
return getValueCollection();
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP:
if (coreType) return getSimpleFeatureCollectionGroup();
return ((FeatureMap.Internal)getSimpleFeatureCollectionGroup()).getWrapper();
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION:
return getSimpleFeatureCollection();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION:
setValueCollection((ValueCollectionType)newValue);
return;
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP:
((FeatureMap.Internal)getSimpleFeatureCollectionGroup()).set(newValue);
return;
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION:
setSimpleFeatureCollection((SimpleFeatureCollectionType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION:
setValueCollection((ValueCollectionType)null);
return;
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP:
getSimpleFeatureCollectionGroup().clear();
return;
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION:
setSimpleFeatureCollection((SimpleFeatureCollectionType)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Wfs20Package.ADDITIONAL_VALUES_TYPE__VALUE_COLLECTION:
return valueCollection != null;
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION_GROUP:
return simpleFeatureCollectionGroup != null && !simpleFeatureCollectionGroup.isEmpty();
case Wfs20Package.ADDITIONAL_VALUES_TYPE__SIMPLE_FEATURE_COLLECTION:
return getSimpleFeatureCollection() != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (simpleFeatureCollectionGroup: ");
result.append(simpleFeatureCollectionGroup);
result.append(')');
return result.toString();
}
} //AdditionalValuesTypeImpl