1 | /** |
2 | * Copyright 2008, sdq.ipd.uka.de, U KA |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.simucomframework.simucomstatus.impl; |
7 | |
8 | import de.uka.ipd.sdq.simucomframework.simucomstatus.SimucomstatusPackage; |
9 | import de.uka.ipd.sdq.simucomframework.simucomstatus.WaitForDelay; |
10 | |
11 | import org.eclipse.emf.common.notify.Notification; |
12 | |
13 | import org.eclipse.emf.ecore.EClass; |
14 | |
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
16 | |
17 | /** |
18 | * <!-- begin-user-doc --> |
19 | * An implementation of the model object '<em><b>Wait For Delay</b></em>'. |
20 | * <!-- end-user-doc --> |
21 | * <p> |
22 | * The following features are implemented: |
23 | * <ul> |
24 | * <li>{@link de.uka.ipd.sdq.simucomframework.simucomstatus.impl.WaitForDelayImpl#getDelay <em>Delay</em>}</li> |
25 | * </ul> |
26 | * </p> |
27 | * |
28 | * @generated |
29 | */ |
30 | public class WaitForDelayImpl extends ActionImpl implements WaitForDelay { |
31 | /** |
32 | * The default value of the '{@link #getDelay() <em>Delay</em>}' attribute. |
33 | * <!-- begin-user-doc --> |
34 | * <!-- end-user-doc --> |
35 | * @see #getDelay() |
36 | * @generated |
37 | * @ordered |
38 | */ |
39 | protected static final double DELAY_EDEFAULT = 0.0; |
40 | |
41 | /** |
42 | * The cached value of the '{@link #getDelay() <em>Delay</em>}' attribute. |
43 | * <!-- begin-user-doc --> |
44 | * <!-- end-user-doc --> |
45 | * @see #getDelay() |
46 | * @generated |
47 | * @ordered |
48 | */ |
49 | protected double delay = DELAY_EDEFAULT; |
50 | |
51 | /** |
52 | * <!-- begin-user-doc --> |
53 | * <!-- end-user-doc --> |
54 | * @generated |
55 | */ |
56 | protected WaitForDelayImpl() { |
57 | super(); |
58 | } |
59 | |
60 | /** |
61 | * <!-- begin-user-doc --> |
62 | * <!-- end-user-doc --> |
63 | * @generated |
64 | */ |
65 | @Override |
66 | protected EClass eStaticClass() { |
67 | return SimucomstatusPackage.Literals.WAIT_FOR_DELAY; |
68 | } |
69 | |
70 | /** |
71 | * <!-- begin-user-doc --> |
72 | * <!-- end-user-doc --> |
73 | * @generated |
74 | */ |
75 | public double getDelay() { |
76 | return delay; |
77 | } |
78 | |
79 | /** |
80 | * <!-- begin-user-doc --> |
81 | * <!-- end-user-doc --> |
82 | * @generated |
83 | */ |
84 | public void setDelay(double newDelay) { |
85 | double oldDelay = delay; |
86 | delay = newDelay; |
87 | if (eNotificationRequired()) |
88 | eNotify(new ENotificationImpl(this, Notification.SET, SimucomstatusPackage.WAIT_FOR_DELAY__DELAY, oldDelay, delay)); |
89 | } |
90 | |
91 | /** |
92 | * <!-- begin-user-doc --> |
93 | * <!-- end-user-doc --> |
94 | * @generated |
95 | */ |
96 | @Override |
97 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
98 | switch (featureID) { |
99 | case SimucomstatusPackage.WAIT_FOR_DELAY__DELAY: |
100 | return new Double(getDelay()); |
101 | } |
102 | return super.eGet(featureID, resolve, coreType); |
103 | } |
104 | |
105 | /** |
106 | * <!-- begin-user-doc --> |
107 | * <!-- end-user-doc --> |
108 | * @generated |
109 | */ |
110 | @Override |
111 | public void eSet(int featureID, Object newValue) { |
112 | switch (featureID) { |
113 | case SimucomstatusPackage.WAIT_FOR_DELAY__DELAY: |
114 | setDelay(((Double)newValue).doubleValue()); |
115 | return; |
116 | } |
117 | super.eSet(featureID, newValue); |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | @Override |
126 | public void eUnset(int featureID) { |
127 | switch (featureID) { |
128 | case SimucomstatusPackage.WAIT_FOR_DELAY__DELAY: |
129 | setDelay(DELAY_EDEFAULT); |
130 | return; |
131 | } |
132 | super.eUnset(featureID); |
133 | } |
134 | |
135 | /** |
136 | * <!-- begin-user-doc --> |
137 | * <!-- end-user-doc --> |
138 | * @generated |
139 | */ |
140 | @Override |
141 | public boolean eIsSet(int featureID) { |
142 | switch (featureID) { |
143 | case SimucomstatusPackage.WAIT_FOR_DELAY__DELAY: |
144 | return delay != DELAY_EDEFAULT; |
145 | } |
146 | return super.eIsSet(featureID); |
147 | } |
148 | |
149 | /** |
150 | * <!-- begin-user-doc --> |
151 | * <!-- end-user-doc --> |
152 | * @generated |
153 | */ |
154 | @Override |
155 | public String toString() { |
156 | if (eIsProxy()) return super.toString(); |
157 | |
158 | StringBuffer result = new StringBuffer(super.toString()); |
159 | result.append(" (delay: "); |
160 | result.append(delay); |
161 | result.append(')'); |
162 | return result.toString(); |
163 | } |
164 | |
165 | } //WaitForDelayImpl |