001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: BlackboardEntryImpl.java 16525 2005-10-27 01:38:05Z jeichar $
006: */package net.refractions.udig.project.internal.impl;
007:
008: import net.refractions.udig.project.internal.BlackboardEntry;
009: import net.refractions.udig.project.internal.ProjectPackage;
010:
011: import org.eclipse.emf.common.notify.Notification;
012: import org.eclipse.emf.ecore.EClass;
013: import org.eclipse.emf.ecore.EStructuralFeature;
014: import org.eclipse.emf.ecore.impl.ENotificationImpl;
015: import org.eclipse.emf.ecore.impl.EObjectImpl;
016:
017: /**
018: * TODO Purpose of net.refractions.udig.project.internal.impl
019: * <p>
020: * </p>
021: *
022: * @author Jesse
023: * @since 1.0.0
024: * @generated
025: */
026: public class BlackboardEntryImpl extends EObjectImpl implements
027: BlackboardEntry {
028: /**
029: * <!-- begin-user-doc --> <!-- end-user-doc -->
030: * @generated
031: */
032: public static final String copyright = "uDig - User Friendly Desktop Internet GIS client http://udig.refractions.net (C) 2004, Refractions Research Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details."; //$NON-NLS-1$
033:
034: /**
035: * The default value of the '{@link #getKey() <em>Key</em>}' attribute.
036: * <!-- begin-user-doc
037: * --> <!-- end-user-doc -->
038: * @see #getKey()
039: * @generated
040: * @ordered
041: */
042: protected static final String KEY_EDEFAULT = null;
043:
044: /**
045: * The cached value of the '{@link #getKey() <em>Key</em>}' attribute.
046: * <!-- begin-user-doc -->
047: * <!-- end-user-doc -->
048: * @see #getKey()
049: * @generated
050: * @ordered
051: */
052: protected String key = KEY_EDEFAULT;
053:
054: /**
055: * The default value of the '{@link #getMemento() <em>Memento</em>}' attribute. <!--
056: * begin-user-doc --> <!-- end-user-doc -->
057: *
058: * @see #getMemento()
059: * @generated
060: * @ordered
061: */
062: protected static final String MEMENTO_EDEFAULT = null;
063:
064: /**
065: * The cached value of the '{@link #getMemento() <em>Memento</em>}' attribute. <!--
066: * begin-user-doc --> <!-- end-user-doc -->
067: *
068: * @see #getMemento()
069: * @generated
070: * @ordered
071: */
072: protected String memento = MEMENTO_EDEFAULT;
073:
074: /**
075: * The default value of the '{@link #getObjectClass() <em>Object Class</em>}' attribute. <!--
076: * begin-user-doc --> <!-- end-user-doc -->
077: *
078: * @see #getObjectClass()
079: * @generated
080: * @ordered
081: */
082: protected static final Class OBJECT_CLASS_EDEFAULT = null;
083:
084: /**
085: * The default value of the '{@link #getObject() <em>Object</em>}' attribute. <!--
086: * begin-user-doc --> <!-- end-user-doc -->
087: *
088: * @see #getObject()
089: * @generated
090: * @ordered
091: */
092: protected static final Object OBJECT_EDEFAULT = null;
093:
094: /** reference to object * */
095: private Object ref;
096:
097: /** class cache, disapears when app shuts down * */
098: private Class objectClass;
099:
100: /**
101: * <!-- begin-user-doc --> <!-- end-user-doc -->
102: * @generated
103: */
104: protected BlackboardEntryImpl() {
105: super ();
106: }
107:
108: /**
109: * <!-- begin-user-doc --> <!-- end-user-doc -->
110: * @generated
111: */
112: protected EClass eStaticClass() {
113: return ProjectPackage.eINSTANCE.getBlackboardEntry();
114: }
115:
116: /**
117: * <!-- begin-user-doc --> <!-- end-user-doc -->
118: * @generated
119: */
120: public String getKey() {
121: return key;
122: }
123:
124: /**
125: * <!-- begin-user-doc --> <!-- end-user-doc -->
126: * @generated
127: */
128: public void setKey(String newKey) {
129: String oldKey = key;
130: key = newKey;
131: if (eNotificationRequired())
132: eNotify(new ENotificationImpl(this , Notification.SET,
133: ProjectPackage.BLACKBOARD_ENTRY__KEY, oldKey, key));
134: }
135:
136: /**
137: * <!-- begin-user-doc --> <!-- end-user-doc -->
138: * @generated
139: */
140: public String getMemento() {
141: return memento;
142: }
143:
144: /**
145: * <!-- begin-user-doc --> <!-- end-user-doc -->
146: * @generated
147: */
148: public void setMemento(String newMemento) {
149: String oldMemento = memento;
150: memento = newMemento;
151: if (eNotificationRequired())
152: eNotify(new ENotificationImpl(this , Notification.SET,
153: ProjectPackage.BLACKBOARD_ENTRY__MEMENTO,
154: oldMemento, memento));
155: }
156:
157: /**
158: * <!-- begin-user-doc --> <!-- end-user-doc -->
159: *
160: * @uml.property name="objectClass"
161: * @generated NOT
162: */
163: public Class getObjectClass() {
164: return objectClass;
165: }
166:
167: /**
168: * <!-- begin-user-doc --> <!-- end-user-doc -->
169: *
170: * @uml.property name="objectClass"
171: * @generated NOT
172: */
173: public void setObjectClass(Class newObjectClass) {
174: objectClass = newObjectClass;
175: }
176:
177: /**
178: * <!-- begin-user-doc --> <!-- end-user-doc -->
179: *
180: * @generated NOT
181: */
182: public Object getObject() {
183: return ref;
184: }
185:
186: /**
187: * <!-- begin-user-doc --> <!-- end-user-doc -->
188: *
189: * @generated NOT
190: */
191: public void setObject(Object newObject) {
192: ref = newObject;
193: }
194:
195: /**
196: * <!-- begin-user-doc --> <!-- end-user-doc -->
197: * @generated
198: */
199: public Object eGet(EStructuralFeature eFeature, boolean resolve) {
200: switch (eDerivedStructuralFeatureID(eFeature)) {
201: case ProjectPackage.BLACKBOARD_ENTRY__KEY:
202: return getKey();
203: case ProjectPackage.BLACKBOARD_ENTRY__MEMENTO:
204: return getMemento();
205: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT_CLASS:
206: return getObjectClass();
207: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT:
208: return getObject();
209: }
210: return eDynamicGet(eFeature, resolve);
211: }
212:
213: /**
214: * <!-- begin-user-doc --> <!-- end-user-doc -->
215: * @generated
216: */
217: public void eSet(EStructuralFeature eFeature, Object newValue) {
218: switch (eDerivedStructuralFeatureID(eFeature)) {
219: case ProjectPackage.BLACKBOARD_ENTRY__KEY:
220: setKey((String) newValue);
221: return;
222: case ProjectPackage.BLACKBOARD_ENTRY__MEMENTO:
223: setMemento((String) newValue);
224: return;
225: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT_CLASS:
226: setObjectClass((Class) newValue);
227: return;
228: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT:
229: setObject((Object) newValue);
230: return;
231: }
232: eDynamicSet(eFeature, newValue);
233: }
234:
235: /**
236: * <!-- begin-user-doc --> <!-- end-user-doc -->
237: * @generated
238: */
239: public void eUnset(EStructuralFeature eFeature) {
240: switch (eDerivedStructuralFeatureID(eFeature)) {
241: case ProjectPackage.BLACKBOARD_ENTRY__KEY:
242: setKey(KEY_EDEFAULT);
243: return;
244: case ProjectPackage.BLACKBOARD_ENTRY__MEMENTO:
245: setMemento(MEMENTO_EDEFAULT);
246: return;
247: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT_CLASS:
248: setObjectClass(OBJECT_CLASS_EDEFAULT);
249: return;
250: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT:
251: setObject(OBJECT_EDEFAULT);
252: return;
253: }
254: eDynamicUnset(eFeature);
255: }
256:
257: /**
258: * <!-- begin-user-doc --> <!-- end-user-doc -->
259: * @generated
260: */
261: public boolean eIsSet(EStructuralFeature eFeature) {
262: switch (eDerivedStructuralFeatureID(eFeature)) {
263: case ProjectPackage.BLACKBOARD_ENTRY__KEY:
264: return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT
265: .equals(key);
266: case ProjectPackage.BLACKBOARD_ENTRY__MEMENTO:
267: return MEMENTO_EDEFAULT == null ? memento != null
268: : !MEMENTO_EDEFAULT.equals(memento);
269: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT_CLASS:
270: return OBJECT_CLASS_EDEFAULT == null ? getObjectClass() != null
271: : !OBJECT_CLASS_EDEFAULT.equals(getObjectClass());
272: case ProjectPackage.BLACKBOARD_ENTRY__OBJECT:
273: return OBJECT_EDEFAULT == null ? getObject() != null
274: : !OBJECT_EDEFAULT.equals(getObject());
275: }
276: return eDynamicIsSet(eFeature);
277: }
278:
279: /**
280: * <!-- begin-user-doc --> <!-- end-user-doc -->
281: * @generated
282: */
283: public String toString() {
284: if (eIsProxy())
285: return super .toString();
286:
287: StringBuffer result = new StringBuffer(super .toString());
288: result.append(" (key: "); //$NON-NLS-1$
289: result.append(key);
290: result.append(", memento: "); //$NON-NLS-1$
291: result.append(memento);
292: result.append(')');
293: return result.toString();
294: }
295:
296: } // BlackboardEntryImpl
|