001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id$
006: */package newprocess.impl;
007:
008: import newprocess.Condition;
009: import newprocess.NewprocessPackage;
010: import newprocess.validation.ConditionValidator;
011: import newprocess.validation.ConditionValidatorImpl;
012:
013: import org.eclipse.emf.common.notify.Notification;
014: import org.eclipse.emf.ecore.EClass;
015: import org.eclipse.emf.ecore.impl.ENotificationImpl;
016:
017: /**
018: * <!-- begin-user-doc -->
019: * An implementation of the model object '<em><b>Condition</b></em>'.
020: * <!-- end-user-doc -->
021: * <p>
022: * The following features are implemented:
023: * <ul>
024: * <li>{@link newprocess.impl.ConditionImpl#isTemporal <em>Temporal</em>}</li>
025: * <li>{@link newprocess.impl.ConditionImpl#isTagged <em>Tagged</em>}</li>
026: * </ul>
027: * </p>
028: *
029: * @generated NOT
030: * @author sh
031: */
032: public class ConditionImpl extends ElementImpl implements Condition,
033: ConditionValidator {
034:
035: /**
036: * The default value of the '{@link #isTemporal() <em>Temporal</em>}' attribute.
037: * <!-- begin-user-doc -->
038: * <!-- end-user-doc -->
039: * @see #isTemporal()
040: * @generated
041: * @ordered
042: */
043: protected static final boolean TEMPORAL_EDEFAULT = false;
044:
045: /**
046: * The cached value of the '{@link #isTemporal() <em>Temporal</em>}' attribute.
047: * <!-- begin-user-doc -->
048: * <!-- end-user-doc -->
049: * @see #isTemporal()
050: * @generated
051: * @ordered
052: */
053: protected boolean temporal = TEMPORAL_EDEFAULT;
054:
055: /**
056: * The default value of the '{@link #isTagged() <em>Tagged</em>}' attribute.
057: * <!-- begin-user-doc -->
058: * <!-- end-user-doc -->
059: * @see #isTagged()
060: * @generated
061: * @ordered
062: */
063: protected static final boolean TAGGED_EDEFAULT = false;
064:
065: /**
066: * The cached value of the '{@link #isTagged() <em>Tagged</em>}' attribute.
067: * <!-- begin-user-doc -->
068: * <!-- end-user-doc -->
069: * @see #isTagged()
070: * @generated
071: * @ordered
072: */
073: protected boolean tagged = TAGGED_EDEFAULT;
074:
075: /**
076: * <!-- begin-user-doc -->
077: * <!-- end-user-doc -->
078: * @generated
079: */
080: protected ConditionImpl() {
081: super ();
082: }
083:
084: /**
085: * <!-- begin-user-doc -->
086: * <!-- end-user-doc -->
087: * @generated
088: */
089: @Override
090: protected EClass eStaticClass() {
091: return NewprocessPackage.Literals.CONDITION;
092: }
093:
094: /**
095: * <!-- begin-user-doc -->
096: * <!-- end-user-doc -->
097: * @generated
098: */
099: public boolean isTemporal() {
100: return temporal;
101: }
102:
103: /**
104: * <!-- begin-user-doc -->
105: * <!-- end-user-doc -->
106: * @generated
107: */
108: public void setTemporal(boolean newTemporal) {
109: boolean oldTemporal = temporal;
110: temporal = newTemporal;
111: if (eNotificationRequired())
112: eNotify(new ENotificationImpl(this , Notification.SET,
113: NewprocessPackage.CONDITION__TEMPORAL, oldTemporal,
114: temporal));
115: }
116:
117: /**
118: * <!-- begin-user-doc -->
119: * <!-- end-user-doc -->
120: * @generated
121: */
122: public boolean isTagged() {
123: return tagged;
124: }
125:
126: /**
127: * <!-- begin-user-doc -->
128: * <!-- end-user-doc -->
129: * @generated
130: */
131: public void setTagged(boolean newTagged) {
132: boolean oldTagged = tagged;
133: tagged = newTagged;
134: if (eNotificationRequired())
135: eNotify(new ENotificationImpl(this , Notification.SET,
136: NewprocessPackage.CONDITION__TAGGED, oldTagged,
137: tagged));
138: }
139:
140: /**
141: * <!-- begin-user-doc -->
142: * <!-- end-user-doc -->
143: * @generated NOT
144: * @author sh
145: */
146: public void performUpdate() {
147: // TODO: implement this method
148: // Ensure that you remove @generated or mark it @generated NOT
149: throw new UnsupportedOperationException();
150:
151: /*
152: CompositeCondition precon = getHasPrecondition();
153: CompositeCondition postcon = getHasPostcondition();
154: if (precon != null)
155: precon.updateName();
156: if (postcon != null)
157: postcon.updateName();
158: */
159: }
160:
161: /**
162: * <!-- begin-user-doc -->
163: * <!-- end-user-doc -->
164: * @generated
165: */
166: @Override
167: public Object eGet(int featureID, boolean resolve, boolean coreType) {
168: switch (featureID) {
169: case NewprocessPackage.CONDITION__TEMPORAL:
170: return isTemporal() ? Boolean.TRUE : Boolean.FALSE;
171: case NewprocessPackage.CONDITION__TAGGED:
172: return isTagged() ? Boolean.TRUE : Boolean.FALSE;
173: }
174: return super .eGet(featureID, resolve, coreType);
175: }
176:
177: /**
178: * <!-- begin-user-doc -->
179: * <!-- end-user-doc -->
180: * @generated
181: */
182: @Override
183: public void eSet(int featureID, Object newValue) {
184: switch (featureID) {
185: case NewprocessPackage.CONDITION__TEMPORAL:
186: setTemporal(((Boolean) newValue).booleanValue());
187: return;
188: case NewprocessPackage.CONDITION__TAGGED:
189: setTagged(((Boolean) newValue).booleanValue());
190: return;
191: }
192: super .eSet(featureID, newValue);
193: }
194:
195: /**
196: * <!-- begin-user-doc -->
197: * <!-- end-user-doc -->
198: * @generated
199: */
200: @Override
201: public void eUnset(int featureID) {
202: switch (featureID) {
203: case NewprocessPackage.CONDITION__TEMPORAL:
204: setTemporal(TEMPORAL_EDEFAULT);
205: return;
206: case NewprocessPackage.CONDITION__TAGGED:
207: setTagged(TAGGED_EDEFAULT);
208: return;
209: }
210: super .eUnset(featureID);
211: }
212:
213: /**
214: * <!-- begin-user-doc -->
215: * <!-- end-user-doc -->
216: * @generated
217: */
218: @Override
219: public boolean eIsSet(int featureID) {
220: switch (featureID) {
221: case NewprocessPackage.CONDITION__TEMPORAL:
222: return temporal != TEMPORAL_EDEFAULT;
223: case NewprocessPackage.CONDITION__TAGGED:
224: return tagged != TAGGED_EDEFAULT;
225: }
226: return super .eIsSet(featureID);
227: }
228:
229: /**
230: * <!-- begin-user-doc -->
231: * <!-- end-user-doc -->
232: * @generated
233: */
234: @Override
235: public String toString() {
236: if (eIsProxy())
237: return super .toString();
238:
239: StringBuffer result = new StringBuffer(super .toString());
240: result.append(" (temporal: ");
241: result.append(temporal);
242: result.append(", tagged: ");
243: result.append(tagged);
244: result.append(')');
245: return result.toString();
246: }
247:
248: /**
249: * Validates the Implementation of the Condition
250: * @author sh
251: */
252: public boolean validateImplementation(Condition con) {
253: return ConditionValidatorImpl.INSTANCE
254: .validateImplementation(con);
255: }
256:
257: /**
258: * Validates the Name of the Condition
259: * @author sh
260: */
261: public boolean validateName(Condition con) {
262: return ConditionValidatorImpl.INSTANCE.validateName(con);
263: }
264: } //ConditionImpl
|