001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: ResponsiblePartySubsetTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import net.opengis.ows.CodeType;
009: import net.opengis.ows.ContactType;
010: import net.opengis.ows.OwsPackage;
011: import net.opengis.ows.ResponsiblePartySubsetType;
012:
013: import org.eclipse.emf.common.notify.Notification;
014: import org.eclipse.emf.common.notify.NotificationChain;
015:
016: import org.eclipse.emf.ecore.EClass;
017: import org.eclipse.emf.ecore.InternalEObject;
018:
019: import org.eclipse.emf.ecore.impl.ENotificationImpl;
020: import org.eclipse.emf.ecore.impl.EObjectImpl;
021:
022: /**
023: * <!-- begin-user-doc -->
024: * An implementation of the model object '<em><b>Responsible Party Subset Type</b></em>'.
025: * <!-- end-user-doc -->
026: * <p>
027: * The following features are implemented:
028: * <ul>
029: * <li>{@link net.opengis.ows.impl.ResponsiblePartySubsetTypeImpl#getIndividualName <em>Individual Name</em>}</li>
030: * <li>{@link net.opengis.ows.impl.ResponsiblePartySubsetTypeImpl#getPositionName <em>Position Name</em>}</li>
031: * <li>{@link net.opengis.ows.impl.ResponsiblePartySubsetTypeImpl#getContactInfo <em>Contact Info</em>}</li>
032: * <li>{@link net.opengis.ows.impl.ResponsiblePartySubsetTypeImpl#getRole <em>Role</em>}</li>
033: * </ul>
034: * </p>
035: *
036: * @generated
037: */
038: public class ResponsiblePartySubsetTypeImpl extends EObjectImpl
039: implements ResponsiblePartySubsetType {
040: /**
041: * The default value of the '{@link #getIndividualName() <em>Individual Name</em>}' attribute.
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @see #getIndividualName()
045: * @generated
046: * @ordered
047: */
048: protected static final String INDIVIDUAL_NAME_EDEFAULT = null;
049:
050: /**
051: * The cached value of the '{@link #getIndividualName() <em>Individual Name</em>}' attribute.
052: * <!-- begin-user-doc -->
053: * <!-- end-user-doc -->
054: * @see #getIndividualName()
055: * @generated
056: * @ordered
057: */
058: protected String individualName = INDIVIDUAL_NAME_EDEFAULT;
059:
060: /**
061: * The default value of the '{@link #getPositionName() <em>Position Name</em>}' attribute.
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: * @see #getPositionName()
065: * @generated
066: * @ordered
067: */
068: protected static final String POSITION_NAME_EDEFAULT = null;
069:
070: /**
071: * The cached value of the '{@link #getPositionName() <em>Position Name</em>}' attribute.
072: * <!-- begin-user-doc -->
073: * <!-- end-user-doc -->
074: * @see #getPositionName()
075: * @generated
076: * @ordered
077: */
078: protected String positionName = POSITION_NAME_EDEFAULT;
079:
080: /**
081: * The cached value of the '{@link #getContactInfo() <em>Contact Info</em>}' containment reference.
082: * <!-- begin-user-doc -->
083: * <!-- end-user-doc -->
084: * @see #getContactInfo()
085: * @generated
086: * @ordered
087: */
088: protected ContactType contactInfo;
089:
090: /**
091: * The cached value of the '{@link #getRole() <em>Role</em>}' containment reference.
092: * <!-- begin-user-doc -->
093: * <!-- end-user-doc -->
094: * @see #getRole()
095: * @generated
096: * @ordered
097: */
098: protected CodeType role;
099:
100: /**
101: * <!-- begin-user-doc -->
102: * <!-- end-user-doc -->
103: * @generated
104: */
105: protected ResponsiblePartySubsetTypeImpl() {
106: super ();
107: }
108:
109: /**
110: * <!-- begin-user-doc -->
111: * <!-- end-user-doc -->
112: * @generated
113: */
114: protected EClass eStaticClass() {
115: return OwsPackage.Literals.RESPONSIBLE_PARTY_SUBSET_TYPE;
116: }
117:
118: /**
119: * <!-- begin-user-doc -->
120: * <!-- end-user-doc -->
121: * @generated
122: */
123: public String getIndividualName() {
124: return individualName;
125: }
126:
127: /**
128: * <!-- begin-user-doc -->
129: * <!-- end-user-doc -->
130: * @generated
131: */
132: public void setIndividualName(String newIndividualName) {
133: String oldIndividualName = individualName;
134: individualName = newIndividualName;
135: if (eNotificationRequired())
136: eNotify(new ENotificationImpl(
137: this ,
138: Notification.SET,
139: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__INDIVIDUAL_NAME,
140: oldIndividualName, individualName));
141: }
142:
143: /**
144: * <!-- begin-user-doc -->
145: * <!-- end-user-doc -->
146: * @generated
147: */
148: public String getPositionName() {
149: return positionName;
150: }
151:
152: /**
153: * <!-- begin-user-doc -->
154: * <!-- end-user-doc -->
155: * @generated
156: */
157: public void setPositionName(String newPositionName) {
158: String oldPositionName = positionName;
159: positionName = newPositionName;
160: if (eNotificationRequired())
161: eNotify(new ENotificationImpl(
162: this ,
163: Notification.SET,
164: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__POSITION_NAME,
165: oldPositionName, positionName));
166: }
167:
168: /**
169: * <!-- begin-user-doc -->
170: * <!-- end-user-doc -->
171: * @generated
172: */
173: public ContactType getContactInfo() {
174: return contactInfo;
175: }
176:
177: /**
178: * <!-- begin-user-doc -->
179: * <!-- end-user-doc -->
180: * @generated
181: */
182: public NotificationChain basicSetContactInfo(
183: ContactType newContactInfo, NotificationChain msgs) {
184: ContactType oldContactInfo = contactInfo;
185: contactInfo = newContactInfo;
186: if (eNotificationRequired()) {
187: ENotificationImpl notification = new ENotificationImpl(
188: this ,
189: Notification.SET,
190: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO,
191: oldContactInfo, newContactInfo);
192: if (msgs == null)
193: msgs = notification;
194: else
195: msgs.add(notification);
196: }
197: return msgs;
198: }
199:
200: /**
201: * <!-- begin-user-doc -->
202: * <!-- end-user-doc -->
203: * @generated
204: */
205: public void setContactInfo(ContactType newContactInfo) {
206: if (newContactInfo != contactInfo) {
207: NotificationChain msgs = null;
208: if (contactInfo != null)
209: msgs = ((InternalEObject) contactInfo)
210: .eInverseRemove(
211: this ,
212: EOPPOSITE_FEATURE_BASE
213: - OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO,
214: null, msgs);
215: if (newContactInfo != null)
216: msgs = ((InternalEObject) newContactInfo)
217: .eInverseAdd(
218: this ,
219: EOPPOSITE_FEATURE_BASE
220: - OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO,
221: null, msgs);
222: msgs = basicSetContactInfo(newContactInfo, msgs);
223: if (msgs != null)
224: msgs.dispatch();
225: } else if (eNotificationRequired())
226: eNotify(new ENotificationImpl(
227: this ,
228: Notification.SET,
229: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO,
230: newContactInfo, newContactInfo));
231: }
232:
233: /**
234: * <!-- begin-user-doc -->
235: * <!-- end-user-doc -->
236: * @generated
237: */
238: public CodeType getRole() {
239: return role;
240: }
241:
242: /**
243: * <!-- begin-user-doc -->
244: * <!-- end-user-doc -->
245: * @generated
246: */
247: public NotificationChain basicSetRole(CodeType newRole,
248: NotificationChain msgs) {
249: CodeType oldRole = role;
250: role = newRole;
251: if (eNotificationRequired()) {
252: ENotificationImpl notification = new ENotificationImpl(
253: this , Notification.SET,
254: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE,
255: oldRole, newRole);
256: if (msgs == null)
257: msgs = notification;
258: else
259: msgs.add(notification);
260: }
261: return msgs;
262: }
263:
264: /**
265: * <!-- begin-user-doc -->
266: * <!-- end-user-doc -->
267: * @generated
268: */
269: public void setRole(CodeType newRole) {
270: if (newRole != role) {
271: NotificationChain msgs = null;
272: if (role != null)
273: msgs = ((InternalEObject) role)
274: .eInverseRemove(
275: this ,
276: EOPPOSITE_FEATURE_BASE
277: - OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE,
278: null, msgs);
279: if (newRole != null)
280: msgs = ((InternalEObject) newRole)
281: .eInverseAdd(
282: this ,
283: EOPPOSITE_FEATURE_BASE
284: - OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE,
285: null, msgs);
286: msgs = basicSetRole(newRole, msgs);
287: if (msgs != null)
288: msgs.dispatch();
289: } else if (eNotificationRequired())
290: eNotify(new ENotificationImpl(this , Notification.SET,
291: OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE,
292: newRole, newRole));
293: }
294:
295: /**
296: * <!-- begin-user-doc -->
297: * <!-- end-user-doc -->
298: * @generated
299: */
300: public NotificationChain eInverseRemove(InternalEObject otherEnd,
301: int featureID, NotificationChain msgs) {
302: switch (featureID) {
303: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO:
304: return basicSetContactInfo(null, msgs);
305: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE:
306: return basicSetRole(null, msgs);
307: }
308: return super .eInverseRemove(otherEnd, featureID, msgs);
309: }
310:
311: /**
312: * <!-- begin-user-doc -->
313: * <!-- end-user-doc -->
314: * @generated
315: */
316: public Object eGet(int featureID, boolean resolve, boolean coreType) {
317: switch (featureID) {
318: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__INDIVIDUAL_NAME:
319: return getIndividualName();
320: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__POSITION_NAME:
321: return getPositionName();
322: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO:
323: return getContactInfo();
324: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE:
325: return getRole();
326: }
327: return super .eGet(featureID, resolve, coreType);
328: }
329:
330: /**
331: * <!-- begin-user-doc -->
332: * <!-- end-user-doc -->
333: * @generated
334: */
335: public void eSet(int featureID, Object newValue) {
336: switch (featureID) {
337: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__INDIVIDUAL_NAME:
338: setIndividualName((String) newValue);
339: return;
340: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__POSITION_NAME:
341: setPositionName((String) newValue);
342: return;
343: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO:
344: setContactInfo((ContactType) newValue);
345: return;
346: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE:
347: setRole((CodeType) newValue);
348: return;
349: }
350: super .eSet(featureID, newValue);
351: }
352:
353: /**
354: * <!-- begin-user-doc -->
355: * <!-- end-user-doc -->
356: * @generated
357: */
358: public void eUnset(int featureID) {
359: switch (featureID) {
360: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__INDIVIDUAL_NAME:
361: setIndividualName(INDIVIDUAL_NAME_EDEFAULT);
362: return;
363: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__POSITION_NAME:
364: setPositionName(POSITION_NAME_EDEFAULT);
365: return;
366: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO:
367: setContactInfo((ContactType) null);
368: return;
369: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE:
370: setRole((CodeType) null);
371: return;
372: }
373: super .eUnset(featureID);
374: }
375:
376: /**
377: * <!-- begin-user-doc -->
378: * <!-- end-user-doc -->
379: * @generated
380: */
381: public boolean eIsSet(int featureID) {
382: switch (featureID) {
383: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__INDIVIDUAL_NAME:
384: return INDIVIDUAL_NAME_EDEFAULT == null ? individualName != null
385: : !INDIVIDUAL_NAME_EDEFAULT.equals(individualName);
386: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__POSITION_NAME:
387: return POSITION_NAME_EDEFAULT == null ? positionName != null
388: : !POSITION_NAME_EDEFAULT.equals(positionName);
389: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__CONTACT_INFO:
390: return contactInfo != null;
391: case OwsPackage.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE:
392: return role != null;
393: }
394: return super .eIsSet(featureID);
395: }
396:
397: /**
398: * <!-- begin-user-doc -->
399: * <!-- end-user-doc -->
400: * @generated
401: */
402: public String toString() {
403: if (eIsProxy())
404: return super .toString();
405:
406: StringBuffer result = new StringBuffer(super .toString());
407: result.append(" (individualName: ");
408: result.append(individualName);
409: result.append(", positionName: ");
410: result.append(positionName);
411: result.append(')');
412: return result.toString();
413: }
414:
415: } //ResponsiblePartySubsetTypeImpl
|