001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: ContactTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import net.opengis.ows.AddressType;
009: import net.opengis.ows.ContactType;
010: import net.opengis.ows.OnlineResourceType;
011: import net.opengis.ows.OwsPackage;
012: import net.opengis.ows.TelephoneType;
013:
014: import org.eclipse.emf.common.notify.Notification;
015: import org.eclipse.emf.common.notify.NotificationChain;
016:
017: import org.eclipse.emf.ecore.EClass;
018: import org.eclipse.emf.ecore.InternalEObject;
019:
020: import org.eclipse.emf.ecore.impl.ENotificationImpl;
021: import org.eclipse.emf.ecore.impl.EObjectImpl;
022:
023: /**
024: * <!-- begin-user-doc -->
025: * An implementation of the model object '<em><b>Contact Type</b></em>'.
026: * <!-- end-user-doc -->
027: * <p>
028: * The following features are implemented:
029: * <ul>
030: * <li>{@link net.opengis.ows.impl.ContactTypeImpl#getPhone <em>Phone</em>}</li>
031: * <li>{@link net.opengis.ows.impl.ContactTypeImpl#getAddress <em>Address</em>}</li>
032: * <li>{@link net.opengis.ows.impl.ContactTypeImpl#getOnlineResource <em>Online Resource</em>}</li>
033: * <li>{@link net.opengis.ows.impl.ContactTypeImpl#getHoursOfService <em>Hours Of Service</em>}</li>
034: * <li>{@link net.opengis.ows.impl.ContactTypeImpl#getContactInstructions <em>Contact Instructions</em>}</li>
035: * </ul>
036: * </p>
037: *
038: * @generated
039: */
040: public class ContactTypeImpl extends EObjectImpl implements ContactType {
041: /**
042: * The cached value of the '{@link #getPhone() <em>Phone</em>}' containment reference.
043: * <!-- begin-user-doc -->
044: * <!-- end-user-doc -->
045: * @see #getPhone()
046: * @generated
047: * @ordered
048: */
049: protected TelephoneType phone;
050:
051: /**
052: * The cached value of the '{@link #getAddress() <em>Address</em>}' containment reference.
053: * <!-- begin-user-doc -->
054: * <!-- end-user-doc -->
055: * @see #getAddress()
056: * @generated
057: * @ordered
058: */
059: protected AddressType address;
060:
061: /**
062: * The cached value of the '{@link #getOnlineResource() <em>Online Resource</em>}' containment reference.
063: * <!-- begin-user-doc -->
064: * <!-- end-user-doc -->
065: * @see #getOnlineResource()
066: * @generated
067: * @ordered
068: */
069: protected OnlineResourceType onlineResource;
070:
071: /**
072: * The default value of the '{@link #getHoursOfService() <em>Hours Of Service</em>}' attribute.
073: * <!-- begin-user-doc -->
074: * <!-- end-user-doc -->
075: * @see #getHoursOfService()
076: * @generated
077: * @ordered
078: */
079: protected static final String HOURS_OF_SERVICE_EDEFAULT = null;
080:
081: /**
082: * The cached value of the '{@link #getHoursOfService() <em>Hours Of Service</em>}' attribute.
083: * <!-- begin-user-doc -->
084: * <!-- end-user-doc -->
085: * @see #getHoursOfService()
086: * @generated
087: * @ordered
088: */
089: protected String hoursOfService = HOURS_OF_SERVICE_EDEFAULT;
090:
091: /**
092: * The default value of the '{@link #getContactInstructions() <em>Contact Instructions</em>}' attribute.
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @see #getContactInstructions()
096: * @generated
097: * @ordered
098: */
099: protected static final String CONTACT_INSTRUCTIONS_EDEFAULT = null;
100:
101: /**
102: * The cached value of the '{@link #getContactInstructions() <em>Contact Instructions</em>}' attribute.
103: * <!-- begin-user-doc -->
104: * <!-- end-user-doc -->
105: * @see #getContactInstructions()
106: * @generated
107: * @ordered
108: */
109: protected String contactInstructions = CONTACT_INSTRUCTIONS_EDEFAULT;
110:
111: /**
112: * <!-- begin-user-doc -->
113: * <!-- end-user-doc -->
114: * @generated
115: */
116: protected ContactTypeImpl() {
117: super ();
118: }
119:
120: /**
121: * <!-- begin-user-doc -->
122: * <!-- end-user-doc -->
123: * @generated
124: */
125: protected EClass eStaticClass() {
126: return OwsPackage.Literals.CONTACT_TYPE;
127: }
128:
129: /**
130: * <!-- begin-user-doc -->
131: * <!-- end-user-doc -->
132: * @generated
133: */
134: public TelephoneType getPhone() {
135: return phone;
136: }
137:
138: /**
139: * <!-- begin-user-doc -->
140: * <!-- end-user-doc -->
141: * @generated
142: */
143: public NotificationChain basicSetPhone(TelephoneType newPhone,
144: NotificationChain msgs) {
145: TelephoneType oldPhone = phone;
146: phone = newPhone;
147: if (eNotificationRequired()) {
148: ENotificationImpl notification = new ENotificationImpl(
149: this , Notification.SET,
150: OwsPackage.CONTACT_TYPE__PHONE, oldPhone, newPhone);
151: if (msgs == null)
152: msgs = notification;
153: else
154: msgs.add(notification);
155: }
156: return msgs;
157: }
158:
159: /**
160: * <!-- begin-user-doc -->
161: * <!-- end-user-doc -->
162: * @generated
163: */
164: public void setPhone(TelephoneType newPhone) {
165: if (newPhone != phone) {
166: NotificationChain msgs = null;
167: if (phone != null)
168: msgs = ((InternalEObject) phone).eInverseRemove(this ,
169: EOPPOSITE_FEATURE_BASE
170: - OwsPackage.CONTACT_TYPE__PHONE, null,
171: msgs);
172: if (newPhone != null)
173: msgs = ((InternalEObject) newPhone).eInverseAdd(this ,
174: EOPPOSITE_FEATURE_BASE
175: - OwsPackage.CONTACT_TYPE__PHONE, null,
176: msgs);
177: msgs = basicSetPhone(newPhone, msgs);
178: if (msgs != null)
179: msgs.dispatch();
180: } else if (eNotificationRequired())
181: eNotify(new ENotificationImpl(this , Notification.SET,
182: OwsPackage.CONTACT_TYPE__PHONE, newPhone, newPhone));
183: }
184:
185: /**
186: * <!-- begin-user-doc -->
187: * <!-- end-user-doc -->
188: * @generated
189: */
190: public AddressType getAddress() {
191: return address;
192: }
193:
194: /**
195: * <!-- begin-user-doc -->
196: * <!-- end-user-doc -->
197: * @generated
198: */
199: public NotificationChain basicSetAddress(AddressType newAddress,
200: NotificationChain msgs) {
201: AddressType oldAddress = address;
202: address = newAddress;
203: if (eNotificationRequired()) {
204: ENotificationImpl notification = new ENotificationImpl(
205: this , Notification.SET,
206: OwsPackage.CONTACT_TYPE__ADDRESS, oldAddress,
207: newAddress);
208: if (msgs == null)
209: msgs = notification;
210: else
211: msgs.add(notification);
212: }
213: return msgs;
214: }
215:
216: /**
217: * <!-- begin-user-doc -->
218: * <!-- end-user-doc -->
219: * @generated
220: */
221: public void setAddress(AddressType newAddress) {
222: if (newAddress != address) {
223: NotificationChain msgs = null;
224: if (address != null)
225: msgs = ((InternalEObject) address).eInverseRemove(this ,
226: EOPPOSITE_FEATURE_BASE
227: - OwsPackage.CONTACT_TYPE__ADDRESS,
228: null, msgs);
229: if (newAddress != null)
230: msgs = ((InternalEObject) newAddress).eInverseAdd(this ,
231: EOPPOSITE_FEATURE_BASE
232: - OwsPackage.CONTACT_TYPE__ADDRESS,
233: null, msgs);
234: msgs = basicSetAddress(newAddress, msgs);
235: if (msgs != null)
236: msgs.dispatch();
237: } else if (eNotificationRequired())
238: eNotify(new ENotificationImpl(this , Notification.SET,
239: OwsPackage.CONTACT_TYPE__ADDRESS, newAddress,
240: newAddress));
241: }
242:
243: /**
244: * <!-- begin-user-doc -->
245: * <!-- end-user-doc -->
246: * @generated
247: */
248: public OnlineResourceType getOnlineResource() {
249: return onlineResource;
250: }
251:
252: /**
253: * <!-- begin-user-doc -->
254: * <!-- end-user-doc -->
255: * @generated
256: */
257: public NotificationChain basicSetOnlineResource(
258: OnlineResourceType newOnlineResource, NotificationChain msgs) {
259: OnlineResourceType oldOnlineResource = onlineResource;
260: onlineResource = newOnlineResource;
261: if (eNotificationRequired()) {
262: ENotificationImpl notification = new ENotificationImpl(
263: this , Notification.SET,
264: OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE,
265: oldOnlineResource, newOnlineResource);
266: if (msgs == null)
267: msgs = notification;
268: else
269: msgs.add(notification);
270: }
271: return msgs;
272: }
273:
274: /**
275: * <!-- begin-user-doc -->
276: * <!-- end-user-doc -->
277: * @generated
278: */
279: public void setOnlineResource(OnlineResourceType newOnlineResource) {
280: if (newOnlineResource != onlineResource) {
281: NotificationChain msgs = null;
282: if (onlineResource != null)
283: msgs = ((InternalEObject) onlineResource)
284: .eInverseRemove(
285: this ,
286: EOPPOSITE_FEATURE_BASE
287: - OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE,
288: null, msgs);
289: if (newOnlineResource != null)
290: msgs = ((InternalEObject) newOnlineResource)
291: .eInverseAdd(
292: this ,
293: EOPPOSITE_FEATURE_BASE
294: - OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE,
295: null, msgs);
296: msgs = basicSetOnlineResource(newOnlineResource, msgs);
297: if (msgs != null)
298: msgs.dispatch();
299: } else if (eNotificationRequired())
300: eNotify(new ENotificationImpl(this , Notification.SET,
301: OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE,
302: newOnlineResource, newOnlineResource));
303: }
304:
305: /**
306: * <!-- begin-user-doc -->
307: * <!-- end-user-doc -->
308: * @generated
309: */
310: public String getHoursOfService() {
311: return hoursOfService;
312: }
313:
314: /**
315: * <!-- begin-user-doc -->
316: * <!-- end-user-doc -->
317: * @generated
318: */
319: public void setHoursOfService(String newHoursOfService) {
320: String oldHoursOfService = hoursOfService;
321: hoursOfService = newHoursOfService;
322: if (eNotificationRequired())
323: eNotify(new ENotificationImpl(this , Notification.SET,
324: OwsPackage.CONTACT_TYPE__HOURS_OF_SERVICE,
325: oldHoursOfService, hoursOfService));
326: }
327:
328: /**
329: * <!-- begin-user-doc -->
330: * <!-- end-user-doc -->
331: * @generated
332: */
333: public String getContactInstructions() {
334: return contactInstructions;
335: }
336:
337: /**
338: * <!-- begin-user-doc -->
339: * <!-- end-user-doc -->
340: * @generated
341: */
342: public void setContactInstructions(String newContactInstructions) {
343: String oldContactInstructions = contactInstructions;
344: contactInstructions = newContactInstructions;
345: if (eNotificationRequired())
346: eNotify(new ENotificationImpl(this , Notification.SET,
347: OwsPackage.CONTACT_TYPE__CONTACT_INSTRUCTIONS,
348: oldContactInstructions, contactInstructions));
349: }
350:
351: /**
352: * <!-- begin-user-doc -->
353: * <!-- end-user-doc -->
354: * @generated
355: */
356: public NotificationChain eInverseRemove(InternalEObject otherEnd,
357: int featureID, NotificationChain msgs) {
358: switch (featureID) {
359: case OwsPackage.CONTACT_TYPE__PHONE:
360: return basicSetPhone(null, msgs);
361: case OwsPackage.CONTACT_TYPE__ADDRESS:
362: return basicSetAddress(null, msgs);
363: case OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE:
364: return basicSetOnlineResource(null, msgs);
365: }
366: return super .eInverseRemove(otherEnd, featureID, msgs);
367: }
368:
369: /**
370: * <!-- begin-user-doc -->
371: * <!-- end-user-doc -->
372: * @generated
373: */
374: public Object eGet(int featureID, boolean resolve, boolean coreType) {
375: switch (featureID) {
376: case OwsPackage.CONTACT_TYPE__PHONE:
377: return getPhone();
378: case OwsPackage.CONTACT_TYPE__ADDRESS:
379: return getAddress();
380: case OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE:
381: return getOnlineResource();
382: case OwsPackage.CONTACT_TYPE__HOURS_OF_SERVICE:
383: return getHoursOfService();
384: case OwsPackage.CONTACT_TYPE__CONTACT_INSTRUCTIONS:
385: return getContactInstructions();
386: }
387: return super .eGet(featureID, resolve, coreType);
388: }
389:
390: /**
391: * <!-- begin-user-doc -->
392: * <!-- end-user-doc -->
393: * @generated
394: */
395: public void eSet(int featureID, Object newValue) {
396: switch (featureID) {
397: case OwsPackage.CONTACT_TYPE__PHONE:
398: setPhone((TelephoneType) newValue);
399: return;
400: case OwsPackage.CONTACT_TYPE__ADDRESS:
401: setAddress((AddressType) newValue);
402: return;
403: case OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE:
404: setOnlineResource((OnlineResourceType) newValue);
405: return;
406: case OwsPackage.CONTACT_TYPE__HOURS_OF_SERVICE:
407: setHoursOfService((String) newValue);
408: return;
409: case OwsPackage.CONTACT_TYPE__CONTACT_INSTRUCTIONS:
410: setContactInstructions((String) newValue);
411: return;
412: }
413: super .eSet(featureID, newValue);
414: }
415:
416: /**
417: * <!-- begin-user-doc -->
418: * <!-- end-user-doc -->
419: * @generated
420: */
421: public void eUnset(int featureID) {
422: switch (featureID) {
423: case OwsPackage.CONTACT_TYPE__PHONE:
424: setPhone((TelephoneType) null);
425: return;
426: case OwsPackage.CONTACT_TYPE__ADDRESS:
427: setAddress((AddressType) null);
428: return;
429: case OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE:
430: setOnlineResource((OnlineResourceType) null);
431: return;
432: case OwsPackage.CONTACT_TYPE__HOURS_OF_SERVICE:
433: setHoursOfService(HOURS_OF_SERVICE_EDEFAULT);
434: return;
435: case OwsPackage.CONTACT_TYPE__CONTACT_INSTRUCTIONS:
436: setContactInstructions(CONTACT_INSTRUCTIONS_EDEFAULT);
437: return;
438: }
439: super .eUnset(featureID);
440: }
441:
442: /**
443: * <!-- begin-user-doc -->
444: * <!-- end-user-doc -->
445: * @generated
446: */
447: public boolean eIsSet(int featureID) {
448: switch (featureID) {
449: case OwsPackage.CONTACT_TYPE__PHONE:
450: return phone != null;
451: case OwsPackage.CONTACT_TYPE__ADDRESS:
452: return address != null;
453: case OwsPackage.CONTACT_TYPE__ONLINE_RESOURCE:
454: return onlineResource != null;
455: case OwsPackage.CONTACT_TYPE__HOURS_OF_SERVICE:
456: return HOURS_OF_SERVICE_EDEFAULT == null ? hoursOfService != null
457: : !HOURS_OF_SERVICE_EDEFAULT.equals(hoursOfService);
458: case OwsPackage.CONTACT_TYPE__CONTACT_INSTRUCTIONS:
459: return CONTACT_INSTRUCTIONS_EDEFAULT == null ? contactInstructions != null
460: : !CONTACT_INSTRUCTIONS_EDEFAULT
461: .equals(contactInstructions);
462: }
463: return super .eIsSet(featureID);
464: }
465:
466: /**
467: * <!-- begin-user-doc -->
468: * <!-- end-user-doc -->
469: * @generated
470: */
471: public String toString() {
472: if (eIsProxy())
473: return super .toString();
474:
475: StringBuffer result = new StringBuffer(super .toString());
476: result.append(" (hoursOfService: ");
477: result.append(hoursOfService);
478: result.append(", contactInstructions: ");
479: result.append(contactInstructions);
480: result.append(')');
481: return result.toString();
482: }
483:
484: } //ContactTypeImpl
|