001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: FeatureTypeListTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.wfs.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.wfs.FeatureTypeListType;
011: import net.opengis.wfs.FeatureTypeType;
012: import net.opengis.wfs.OperationsType;
013: import net.opengis.wfs.WfsPackage;
014:
015: import org.eclipse.emf.common.notify.Notification;
016: import org.eclipse.emf.common.notify.NotificationChain;
017:
018: import org.eclipse.emf.common.util.EList;
019:
020: import org.eclipse.emf.ecore.EClass;
021: import org.eclipse.emf.ecore.InternalEObject;
022:
023: import org.eclipse.emf.ecore.impl.ENotificationImpl;
024: import org.eclipse.emf.ecore.impl.EObjectImpl;
025:
026: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
027: import org.eclipse.emf.ecore.util.InternalEList;
028:
029: /**
030: * <!-- begin-user-doc -->
031: * An implementation of the model object '<em><b>Feature Type List Type</b></em>'.
032: * <!-- end-user-doc -->
033: * <p>
034: * The following features are implemented:
035: * <ul>
036: * <li>{@link net.opengis.wfs.impl.FeatureTypeListTypeImpl#getOperations <em>Operations</em>}</li>
037: * <li>{@link net.opengis.wfs.impl.FeatureTypeListTypeImpl#getFeatureType <em>Feature Type</em>}</li>
038: * </ul>
039: * </p>
040: *
041: * @generated
042: */
043: public class FeatureTypeListTypeImpl extends EObjectImpl implements
044: FeatureTypeListType {
045: /**
046: * The cached value of the '{@link #getOperations() <em>Operations</em>}' containment reference.
047: * <!-- begin-user-doc -->
048: * <!-- end-user-doc -->
049: * @see #getOperations()
050: * @generated
051: * @ordered
052: */
053: protected OperationsType operations;
054:
055: /**
056: * The cached value of the '{@link #getFeatureType() <em>Feature Type</em>}' containment reference list.
057: * <!-- begin-user-doc -->
058: * <!-- end-user-doc -->
059: * @see #getFeatureType()
060: * @generated
061: * @ordered
062: */
063: protected EList featureType;
064:
065: /**
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: * @generated
069: */
070: protected FeatureTypeListTypeImpl() {
071: super ();
072: }
073:
074: /**
075: * <!-- begin-user-doc -->
076: * <!-- end-user-doc -->
077: * @generated
078: */
079: protected EClass eStaticClass() {
080: return WfsPackage.Literals.FEATURE_TYPE_LIST_TYPE;
081: }
082:
083: /**
084: * <!-- begin-user-doc -->
085: * <!-- end-user-doc -->
086: * @generated
087: */
088: public OperationsType getOperations() {
089: return operations;
090: }
091:
092: /**
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @generated
096: */
097: public NotificationChain basicSetOperations(
098: OperationsType newOperations, NotificationChain msgs) {
099: OperationsType oldOperations = operations;
100: operations = newOperations;
101: if (eNotificationRequired()) {
102: ENotificationImpl notification = new ENotificationImpl(
103: this , Notification.SET,
104: WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS,
105: oldOperations, newOperations);
106: if (msgs == null)
107: msgs = notification;
108: else
109: msgs.add(notification);
110: }
111: return msgs;
112: }
113:
114: /**
115: * <!-- begin-user-doc -->
116: * <!-- end-user-doc -->
117: * @generated
118: */
119: public void setOperations(OperationsType newOperations) {
120: if (newOperations != operations) {
121: NotificationChain msgs = null;
122: if (operations != null)
123: msgs = ((InternalEObject) operations)
124: .eInverseRemove(
125: this ,
126: EOPPOSITE_FEATURE_BASE
127: - WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS,
128: null, msgs);
129: if (newOperations != null)
130: msgs = ((InternalEObject) newOperations)
131: .eInverseAdd(
132: this ,
133: EOPPOSITE_FEATURE_BASE
134: - WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS,
135: null, msgs);
136: msgs = basicSetOperations(newOperations, msgs);
137: if (msgs != null)
138: msgs.dispatch();
139: } else if (eNotificationRequired())
140: eNotify(new ENotificationImpl(this , Notification.SET,
141: WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS,
142: newOperations, newOperations));
143: }
144:
145: /**
146: * <!-- begin-user-doc -->
147: * <!-- end-user-doc -->
148: * @generated
149: */
150: public EList getFeatureType() {
151: if (featureType == null) {
152: featureType = new EObjectContainmentEList(
153: FeatureTypeType.class, this ,
154: WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE);
155: }
156: return featureType;
157: }
158:
159: /**
160: * <!-- begin-user-doc -->
161: * <!-- end-user-doc -->
162: * @generated
163: */
164: public NotificationChain eInverseRemove(InternalEObject otherEnd,
165: int featureID, NotificationChain msgs) {
166: switch (featureID) {
167: case WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS:
168: return basicSetOperations(null, msgs);
169: case WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE:
170: return ((InternalEList) getFeatureType()).basicRemove(
171: otherEnd, msgs);
172: }
173: return super .eInverseRemove(otherEnd, featureID, msgs);
174: }
175:
176: /**
177: * <!-- begin-user-doc -->
178: * <!-- end-user-doc -->
179: * @generated
180: */
181: public Object eGet(int featureID, boolean resolve, boolean coreType) {
182: switch (featureID) {
183: case WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS:
184: return getOperations();
185: case WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE:
186: return getFeatureType();
187: }
188: return super .eGet(featureID, resolve, coreType);
189: }
190:
191: /**
192: * <!-- begin-user-doc -->
193: * <!-- end-user-doc -->
194: * @generated
195: */
196: public void eSet(int featureID, Object newValue) {
197: switch (featureID) {
198: case WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS:
199: setOperations((OperationsType) newValue);
200: return;
201: case WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE:
202: getFeatureType().clear();
203: getFeatureType().addAll((Collection) newValue);
204: return;
205: }
206: super .eSet(featureID, newValue);
207: }
208:
209: /**
210: * <!-- begin-user-doc -->
211: * <!-- end-user-doc -->
212: * @generated
213: */
214: public void eUnset(int featureID) {
215: switch (featureID) {
216: case WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS:
217: setOperations((OperationsType) null);
218: return;
219: case WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE:
220: getFeatureType().clear();
221: return;
222: }
223: super .eUnset(featureID);
224: }
225:
226: /**
227: * <!-- begin-user-doc -->
228: * <!-- end-user-doc -->
229: * @generated
230: */
231: public boolean eIsSet(int featureID) {
232: switch (featureID) {
233: case WfsPackage.FEATURE_TYPE_LIST_TYPE__OPERATIONS:
234: return operations != null;
235: case WfsPackage.FEATURE_TYPE_LIST_TYPE__FEATURE_TYPE:
236: return featureType != null && !featureType.isEmpty();
237: }
238: return super .eIsSet(featureID);
239: }
240:
241: } //FeatureTypeListTypeImpl
|