001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: TelephoneTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import net.opengis.ows.OwsPackage;
009: import net.opengis.ows.TelephoneType;
010:
011: import org.eclipse.emf.common.notify.Notification;
012:
013: import org.eclipse.emf.ecore.EClass;
014:
015: import org.eclipse.emf.ecore.impl.ENotificationImpl;
016: import org.eclipse.emf.ecore.impl.EObjectImpl;
017:
018: /**
019: * <!-- begin-user-doc -->
020: * An implementation of the model object '<em><b>Telephone Type</b></em>'.
021: * <!-- end-user-doc -->
022: * <p>
023: * The following features are implemented:
024: * <ul>
025: * <li>{@link net.opengis.ows.impl.TelephoneTypeImpl#getVoice <em>Voice</em>}</li>
026: * <li>{@link net.opengis.ows.impl.TelephoneTypeImpl#getFacsimile <em>Facsimile</em>}</li>
027: * </ul>
028: * </p>
029: *
030: * @generated
031: */
032: public class TelephoneTypeImpl extends EObjectImpl implements
033: TelephoneType {
034: /**
035: * The default value of the '{@link #getVoice() <em>Voice</em>}' attribute.
036: * <!-- begin-user-doc -->
037: * <!-- end-user-doc -->
038: * @see #getVoice()
039: * @generated
040: * @ordered
041: */
042: protected static final String VOICE_EDEFAULT = null;
043:
044: /**
045: * The cached value of the '{@link #getVoice() <em>Voice</em>}' attribute.
046: * <!-- begin-user-doc -->
047: * <!-- end-user-doc -->
048: * @see #getVoice()
049: * @generated
050: * @ordered
051: */
052: protected String voice = VOICE_EDEFAULT;
053:
054: /**
055: * The default value of the '{@link #getFacsimile() <em>Facsimile</em>}' attribute.
056: * <!-- begin-user-doc -->
057: * <!-- end-user-doc -->
058: * @see #getFacsimile()
059: * @generated
060: * @ordered
061: */
062: protected static final String FACSIMILE_EDEFAULT = null;
063:
064: /**
065: * The cached value of the '{@link #getFacsimile() <em>Facsimile</em>}' attribute.
066: * <!-- begin-user-doc -->
067: * <!-- end-user-doc -->
068: * @see #getFacsimile()
069: * @generated
070: * @ordered
071: */
072: protected String facsimile = FACSIMILE_EDEFAULT;
073:
074: /**
075: * <!-- begin-user-doc -->
076: * <!-- end-user-doc -->
077: * @generated
078: */
079: protected TelephoneTypeImpl() {
080: super ();
081: }
082:
083: /**
084: * <!-- begin-user-doc -->
085: * <!-- end-user-doc -->
086: * @generated
087: */
088: protected EClass eStaticClass() {
089: return OwsPackage.Literals.TELEPHONE_TYPE;
090: }
091:
092: /**
093: * <!-- begin-user-doc -->
094: * <!-- end-user-doc -->
095: * @generated
096: */
097: public String getVoice() {
098: return voice;
099: }
100:
101: /**
102: * <!-- begin-user-doc -->
103: * <!-- end-user-doc -->
104: * @generated
105: */
106: public void setVoice(String newVoice) {
107: String oldVoice = voice;
108: voice = newVoice;
109: if (eNotificationRequired())
110: eNotify(new ENotificationImpl(this , Notification.SET,
111: OwsPackage.TELEPHONE_TYPE__VOICE, oldVoice, voice));
112: }
113:
114: /**
115: * <!-- begin-user-doc -->
116: * <!-- end-user-doc -->
117: * @generated
118: */
119: public String getFacsimile() {
120: return facsimile;
121: }
122:
123: /**
124: * <!-- begin-user-doc -->
125: * <!-- end-user-doc -->
126: * @generated
127: */
128: public void setFacsimile(String newFacsimile) {
129: String oldFacsimile = facsimile;
130: facsimile = newFacsimile;
131: if (eNotificationRequired())
132: eNotify(new ENotificationImpl(this , Notification.SET,
133: OwsPackage.TELEPHONE_TYPE__FACSIMILE, oldFacsimile,
134: facsimile));
135: }
136:
137: /**
138: * <!-- begin-user-doc -->
139: * <!-- end-user-doc -->
140: * @generated
141: */
142: public Object eGet(int featureID, boolean resolve, boolean coreType) {
143: switch (featureID) {
144: case OwsPackage.TELEPHONE_TYPE__VOICE:
145: return getVoice();
146: case OwsPackage.TELEPHONE_TYPE__FACSIMILE:
147: return getFacsimile();
148: }
149: return super .eGet(featureID, resolve, coreType);
150: }
151:
152: /**
153: * <!-- begin-user-doc -->
154: * <!-- end-user-doc -->
155: * @generated
156: */
157: public void eSet(int featureID, Object newValue) {
158: switch (featureID) {
159: case OwsPackage.TELEPHONE_TYPE__VOICE:
160: setVoice((String) newValue);
161: return;
162: case OwsPackage.TELEPHONE_TYPE__FACSIMILE:
163: setFacsimile((String) newValue);
164: return;
165: }
166: super .eSet(featureID, newValue);
167: }
168:
169: /**
170: * <!-- begin-user-doc -->
171: * <!-- end-user-doc -->
172: * @generated
173: */
174: public void eUnset(int featureID) {
175: switch (featureID) {
176: case OwsPackage.TELEPHONE_TYPE__VOICE:
177: setVoice(VOICE_EDEFAULT);
178: return;
179: case OwsPackage.TELEPHONE_TYPE__FACSIMILE:
180: setFacsimile(FACSIMILE_EDEFAULT);
181: return;
182: }
183: super .eUnset(featureID);
184: }
185:
186: /**
187: * <!-- begin-user-doc -->
188: * <!-- end-user-doc -->
189: * @generated
190: */
191: public boolean eIsSet(int featureID) {
192: switch (featureID) {
193: case OwsPackage.TELEPHONE_TYPE__VOICE:
194: return VOICE_EDEFAULT == null ? voice != null
195: : !VOICE_EDEFAULT.equals(voice);
196: case OwsPackage.TELEPHONE_TYPE__FACSIMILE:
197: return FACSIMILE_EDEFAULT == null ? facsimile != null
198: : !FACSIMILE_EDEFAULT.equals(facsimile);
199: }
200: return super .eIsSet(featureID);
201: }
202:
203: /**
204: * <!-- begin-user-doc -->
205: * <!-- end-user-doc -->
206: * @generated
207: */
208: public String toString() {
209: if (eIsProxy())
210: return super .toString();
211:
212: StringBuffer result = new StringBuffer(super .toString());
213: result.append(" (voice: ");
214: result.append(voice);
215: result.append(", facsimile: ");
216: result.append(facsimile);
217: result.append(')');
218: return result.toString();
219: }
220:
221: } //TelephoneTypeImpl
|