001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: DescriptionTypeImpl.java 7522 2007-09-12 22:00:10Z saul.farber $
006: */package net.opengis.ows.impl;
007:
008: import java.util.Collection;
009:
010: import net.opengis.ows.DescriptionType;
011: import net.opengis.ows.KeywordsType;
012: import net.opengis.ows.OwsPackage;
013:
014: import org.eclipse.emf.common.notify.Notification;
015: import org.eclipse.emf.common.notify.NotificationChain;
016:
017: import org.eclipse.emf.common.util.EList;
018:
019: import org.eclipse.emf.ecore.EClass;
020: import org.eclipse.emf.ecore.InternalEObject;
021:
022: import org.eclipse.emf.ecore.impl.ENotificationImpl;
023: import org.eclipse.emf.ecore.impl.EObjectImpl;
024:
025: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
026: import org.eclipse.emf.ecore.util.InternalEList;
027:
028: /**
029: * <!-- begin-user-doc -->
030: * An implementation of the model object '<em><b>Description Type</b></em>'.
031: * <!-- end-user-doc -->
032: * <p>
033: * The following features are implemented:
034: * <ul>
035: * <li>{@link net.opengis.ows.impl.DescriptionTypeImpl#getTitle <em>Title</em>}</li>
036: * <li>{@link net.opengis.ows.impl.DescriptionTypeImpl#getAbstract <em>Abstract</em>}</li>
037: * <li>{@link net.opengis.ows.impl.DescriptionTypeImpl#getKeywords <em>Keywords</em>}</li>
038: * </ul>
039: * </p>
040: *
041: * @generated
042: */
043: public class DescriptionTypeImpl extends EObjectImpl implements
044: DescriptionType {
045: /**
046: * The default value of the '{@link #getTitle() <em>Title</em>}' attribute.
047: * <!-- begin-user-doc -->
048: * <!-- end-user-doc -->
049: * @see #getTitle()
050: * @generated
051: * @ordered
052: */
053: protected static final String TITLE_EDEFAULT = null;
054:
055: /**
056: * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute.
057: * <!-- begin-user-doc -->
058: * <!-- end-user-doc -->
059: * @see #getTitle()
060: * @generated
061: * @ordered
062: */
063: protected String title = TITLE_EDEFAULT;
064:
065: /**
066: * The default value of the '{@link #getAbstract() <em>Abstract</em>}' attribute.
067: * <!-- begin-user-doc -->
068: * <!-- end-user-doc -->
069: * @see #getAbstract()
070: * @generated
071: * @ordered
072: */
073: protected static final String ABSTRACT_EDEFAULT = null;
074:
075: /**
076: * The cached value of the '{@link #getAbstract() <em>Abstract</em>}' attribute.
077: * <!-- begin-user-doc -->
078: * <!-- end-user-doc -->
079: * @see #getAbstract()
080: * @generated
081: * @ordered
082: */
083: protected String abstract_ = ABSTRACT_EDEFAULT;
084:
085: /**
086: * The cached value of the '{@link #getKeywords() <em>Keywords</em>}' containment reference list.
087: * <!-- begin-user-doc -->
088: * <!-- end-user-doc -->
089: * @see #getKeywords()
090: * @generated
091: * @ordered
092: */
093: protected EList keywords;
094:
095: /**
096: * <!-- begin-user-doc -->
097: * <!-- end-user-doc -->
098: * @generated
099: */
100: protected DescriptionTypeImpl() {
101: super ();
102: }
103:
104: /**
105: * <!-- begin-user-doc -->
106: * <!-- end-user-doc -->
107: * @generated
108: */
109: protected EClass eStaticClass() {
110: return OwsPackage.Literals.DESCRIPTION_TYPE;
111: }
112:
113: /**
114: * <!-- begin-user-doc -->
115: * <!-- end-user-doc -->
116: * @generated
117: */
118: public String getTitle() {
119: return title;
120: }
121:
122: /**
123: * <!-- begin-user-doc -->
124: * <!-- end-user-doc -->
125: * @generated
126: */
127: public void setTitle(String newTitle) {
128: String oldTitle = title;
129: title = newTitle;
130: if (eNotificationRequired())
131: eNotify(new ENotificationImpl(this , Notification.SET,
132: OwsPackage.DESCRIPTION_TYPE__TITLE, oldTitle, title));
133: }
134:
135: /**
136: * <!-- begin-user-doc -->
137: * <!-- end-user-doc -->
138: * @generated
139: */
140: public String getAbstract() {
141: return abstract_;
142: }
143:
144: /**
145: * <!-- begin-user-doc -->
146: * <!-- end-user-doc -->
147: * @generated
148: */
149: public void setAbstract(String newAbstract) {
150: String oldAbstract = abstract_;
151: abstract_ = newAbstract;
152: if (eNotificationRequired())
153: eNotify(new ENotificationImpl(this , Notification.SET,
154: OwsPackage.DESCRIPTION_TYPE__ABSTRACT, oldAbstract,
155: abstract_));
156: }
157:
158: /**
159: * <!-- begin-user-doc -->
160: * <!-- end-user-doc -->
161: * @generated
162: */
163: public EList getKeywords() {
164: if (keywords == null) {
165: keywords = new EObjectContainmentEList(KeywordsType.class,
166: this , OwsPackage.DESCRIPTION_TYPE__KEYWORDS);
167: }
168: return keywords;
169: }
170:
171: /**
172: * <!-- begin-user-doc -->
173: * <!-- end-user-doc -->
174: * @generated
175: */
176: public NotificationChain eInverseRemove(InternalEObject otherEnd,
177: int featureID, NotificationChain msgs) {
178: switch (featureID) {
179: case OwsPackage.DESCRIPTION_TYPE__KEYWORDS:
180: return ((InternalEList) getKeywords()).basicRemove(
181: otherEnd, msgs);
182: }
183: return super .eInverseRemove(otherEnd, featureID, msgs);
184: }
185:
186: /**
187: * <!-- begin-user-doc -->
188: * <!-- end-user-doc -->
189: * @generated
190: */
191: public Object eGet(int featureID, boolean resolve, boolean coreType) {
192: switch (featureID) {
193: case OwsPackage.DESCRIPTION_TYPE__TITLE:
194: return getTitle();
195: case OwsPackage.DESCRIPTION_TYPE__ABSTRACT:
196: return getAbstract();
197: case OwsPackage.DESCRIPTION_TYPE__KEYWORDS:
198: return getKeywords();
199: }
200: return super .eGet(featureID, resolve, coreType);
201: }
202:
203: /**
204: * <!-- begin-user-doc -->
205: * <!-- end-user-doc -->
206: * @generated
207: */
208: public void eSet(int featureID, Object newValue) {
209: switch (featureID) {
210: case OwsPackage.DESCRIPTION_TYPE__TITLE:
211: setTitle((String) newValue);
212: return;
213: case OwsPackage.DESCRIPTION_TYPE__ABSTRACT:
214: setAbstract((String) newValue);
215: return;
216: case OwsPackage.DESCRIPTION_TYPE__KEYWORDS:
217: getKeywords().clear();
218: getKeywords().addAll((Collection) newValue);
219: return;
220: }
221: super .eSet(featureID, newValue);
222: }
223:
224: /**
225: * <!-- begin-user-doc -->
226: * <!-- end-user-doc -->
227: * @generated
228: */
229: public void eUnset(int featureID) {
230: switch (featureID) {
231: case OwsPackage.DESCRIPTION_TYPE__TITLE:
232: setTitle(TITLE_EDEFAULT);
233: return;
234: case OwsPackage.DESCRIPTION_TYPE__ABSTRACT:
235: setAbstract(ABSTRACT_EDEFAULT);
236: return;
237: case OwsPackage.DESCRIPTION_TYPE__KEYWORDS:
238: getKeywords().clear();
239: return;
240: }
241: super .eUnset(featureID);
242: }
243:
244: /**
245: * <!-- begin-user-doc -->
246: * <!-- end-user-doc -->
247: * @generated
248: */
249: public boolean eIsSet(int featureID) {
250: switch (featureID) {
251: case OwsPackage.DESCRIPTION_TYPE__TITLE:
252: return TITLE_EDEFAULT == null ? title != null
253: : !TITLE_EDEFAULT.equals(title);
254: case OwsPackage.DESCRIPTION_TYPE__ABSTRACT:
255: return ABSTRACT_EDEFAULT == null ? abstract_ != null
256: : !ABSTRACT_EDEFAULT.equals(abstract_);
257: case OwsPackage.DESCRIPTION_TYPE__KEYWORDS:
258: return keywords != null && !keywords.isEmpty();
259: }
260: return super .eIsSet(featureID);
261: }
262:
263: /**
264: * <!-- begin-user-doc -->
265: * <!-- end-user-doc -->
266: * @generated
267: */
268: public String toString() {
269: if (eIsProxy())
270: return super .toString();
271:
272: StringBuffer result = new StringBuffer(super .toString());
273: result.append(" (title: ");
274: result.append(title);
275: result.append(", abstract: ");
276: result.append(abstract_);
277: result.append(')');
278: return result.toString();
279: }
280:
281: } //DescriptionTypeImpl
|