001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.impl;
007:
008: import java.util.Collection;
009: import newprocess.Condition;
010: import newprocess.Globals;
011: import newprocess.Loader;
012: import newprocess.NewprocessPackage;
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: import org.eclipse.emf.ecore.EClass;
019: import org.eclipse.emf.ecore.InternalEObject;
020:
021: import org.eclipse.emf.ecore.impl.ENotificationImpl;
022: import org.eclipse.emf.ecore.impl.EObjectImpl;
023: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
024: import org.eclipse.emf.ecore.util.InternalEList;
025:
026: /**
027: * <!-- begin-user-doc -->
028: * An implementation of the model object '<em><b>Globals</b></em>'.
029: * <!-- end-user-doc -->
030: * <p>
031: * The following features are implemented:
032: * <ul>
033: * <li>{@link newprocess.impl.GlobalsImpl#getHasCondition <em>Has Condition</em>}</li>
034: * <li>{@link newprocess.impl.GlobalsImpl#getHasLoader <em>Has Loader</em>}</li>
035: * </ul>
036: * </p>
037: *
038: * @generated
039: */
040: public class GlobalsImpl extends EObjectImpl implements Globals {
041: /**
042: * The cached value of the '{@link #getHasCondition() <em>Has Condition</em>}' containment reference list.
043: * <!-- begin-user-doc -->
044: * <!-- end-user-doc -->
045: * @see #getHasCondition()
046: * @generated
047: * @ordered
048: */
049: protected EList<Condition> hasCondition = null;
050:
051: /**
052: * The cached value of the '{@link #getHasLoader() <em>Has Loader</em>}' containment reference.
053: * <!-- begin-user-doc -->
054: * <!-- end-user-doc -->
055: * @see #getHasLoader()
056: * @generated
057: * @ordered
058: */
059: protected Loader hasLoader = null;
060:
061: /**
062: * <!-- begin-user-doc -->
063: * <!-- end-user-doc -->
064: * @generated
065: */
066: protected GlobalsImpl() {
067: super ();
068: }
069:
070: /**
071: * <!-- begin-user-doc -->
072: * <!-- end-user-doc -->
073: * @generated
074: */
075: @Override
076: protected EClass eStaticClass() {
077: return NewprocessPackage.Literals.GLOBALS;
078: }
079:
080: /**
081: * <!-- begin-user-doc -->
082: * <!-- end-user-doc -->
083: * @generated
084: */
085: public EList<Condition> getHasCondition() {
086: if (hasCondition == null) {
087: hasCondition = new EObjectContainmentEList<Condition>(
088: Condition.class, this ,
089: NewprocessPackage.GLOBALS__HAS_CONDITION);
090: }
091: return hasCondition;
092: }
093:
094: /**
095: * <!-- begin-user-doc -->
096: * <!-- end-user-doc -->
097: * @generated
098: */
099: public Loader getHasLoader() {
100: return hasLoader;
101: }
102:
103: /**
104: * <!-- begin-user-doc -->
105: * <!-- end-user-doc -->
106: * @generated
107: */
108: public NotificationChain basicSetHasLoader(Loader newHasLoader,
109: NotificationChain msgs) {
110: Loader oldHasLoader = hasLoader;
111: hasLoader = newHasLoader;
112: if (eNotificationRequired()) {
113: ENotificationImpl notification = new ENotificationImpl(
114: this , Notification.SET,
115: NewprocessPackage.GLOBALS__HAS_LOADER,
116: oldHasLoader, newHasLoader);
117: if (msgs == null)
118: msgs = notification;
119: else
120: msgs.add(notification);
121: }
122: return msgs;
123: }
124:
125: /**
126: * <!-- begin-user-doc -->
127: * <!-- end-user-doc -->
128: * @generated
129: */
130: public void setHasLoader(Loader newHasLoader) {
131: if (newHasLoader != hasLoader) {
132: NotificationChain msgs = null;
133: if (hasLoader != null)
134: msgs = ((InternalEObject) hasLoader)
135: .eInverseRemove(
136: this ,
137: EOPPOSITE_FEATURE_BASE
138: - NewprocessPackage.GLOBALS__HAS_LOADER,
139: null, msgs);
140: if (newHasLoader != null)
141: msgs = ((InternalEObject) newHasLoader)
142: .eInverseAdd(
143: this ,
144: EOPPOSITE_FEATURE_BASE
145: - NewprocessPackage.GLOBALS__HAS_LOADER,
146: null, msgs);
147: msgs = basicSetHasLoader(newHasLoader, msgs);
148: if (msgs != null)
149: msgs.dispatch();
150: } else if (eNotificationRequired())
151: eNotify(new ENotificationImpl(this , Notification.SET,
152: NewprocessPackage.GLOBALS__HAS_LOADER,
153: newHasLoader, newHasLoader));
154: }
155:
156: /**
157: * <!-- begin-user-doc -->
158: * <!-- end-user-doc -->
159: * @generated
160: */
161: @Override
162: public NotificationChain eInverseRemove(InternalEObject otherEnd,
163: int featureID, NotificationChain msgs) {
164: switch (featureID) {
165: case NewprocessPackage.GLOBALS__HAS_CONDITION:
166: return ((InternalEList<?>) getHasCondition()).basicRemove(
167: otherEnd, msgs);
168: case NewprocessPackage.GLOBALS__HAS_LOADER:
169: return basicSetHasLoader(null, msgs);
170: }
171: return super .eInverseRemove(otherEnd, featureID, msgs);
172: }
173:
174: /**
175: * <!-- begin-user-doc -->
176: * <!-- end-user-doc -->
177: * @generated
178: */
179: @Override
180: public Object eGet(int featureID, boolean resolve, boolean coreType) {
181: switch (featureID) {
182: case NewprocessPackage.GLOBALS__HAS_CONDITION:
183: return getHasCondition();
184: case NewprocessPackage.GLOBALS__HAS_LOADER:
185: return getHasLoader();
186: }
187: return super .eGet(featureID, resolve, coreType);
188: }
189:
190: /**
191: * <!-- begin-user-doc -->
192: * <!-- end-user-doc -->
193: * @generated
194: */
195: @SuppressWarnings("unchecked")
196: @Override
197: public void eSet(int featureID, Object newValue) {
198: switch (featureID) {
199: case NewprocessPackage.GLOBALS__HAS_CONDITION:
200: getHasCondition().clear();
201: getHasCondition().addAll(
202: (Collection<? extends Condition>) newValue);
203: return;
204: case NewprocessPackage.GLOBALS__HAS_LOADER:
205: setHasLoader((Loader) newValue);
206: return;
207: }
208: super .eSet(featureID, newValue);
209: }
210:
211: /**
212: * <!-- begin-user-doc -->
213: * <!-- end-user-doc -->
214: * @generated
215: */
216: @Override
217: public void eUnset(int featureID) {
218: switch (featureID) {
219: case NewprocessPackage.GLOBALS__HAS_CONDITION:
220: getHasCondition().clear();
221: return;
222: case NewprocessPackage.GLOBALS__HAS_LOADER:
223: setHasLoader((Loader) null);
224: return;
225: }
226: super .eUnset(featureID);
227: }
228:
229: /**
230: * <!-- begin-user-doc -->
231: * <!-- end-user-doc -->
232: * @generated
233: */
234: @Override
235: public boolean eIsSet(int featureID) {
236: switch (featureID) {
237: case NewprocessPackage.GLOBALS__HAS_CONDITION:
238: return hasCondition != null && !hasCondition.isEmpty();
239: case NewprocessPackage.GLOBALS__HAS_LOADER:
240: return hasLoader != null;
241: }
242: return super .eIsSet(featureID);
243: }
244:
245: } //GlobalsImpl
|