View Javadoc

1   /**
2    * <copyright>
3    * </copyright>
4    *
5    * $Id$
6    */
7   package BusinessDomainDsl.impl;
8   
9   import BusinessDomainDsl.BusinessDomainDslPackage;
10  import BusinessDomainDsl.DecimalProperty;
11  
12  import org.eclipse.emf.common.notify.Notification;
13  
14  import org.eclipse.emf.ecore.EClass;
15  
16  import org.eclipse.emf.ecore.impl.ENotificationImpl;
17  
18  /**
19   * <!-- begin-user-doc -->
20   * An implementation of the model object '<em><b>Decimal Property</b></em>'.
21   * <!-- end-user-doc -->
22   * <p>
23   * The following features are implemented:
24   * <ul>
25   *   <li>{@link BusinessDomainDsl.impl.DecimalPropertyImpl#getMinValue <em>Min Value</em>}</li>
26   *   <li>{@link BusinessDomainDsl.impl.DecimalPropertyImpl#getMaxValue <em>Max Value</em>}</li>
27   *   <li>{@link BusinessDomainDsl.impl.DecimalPropertyImpl#isMinInclusive <em>Min Inclusive</em>}</li>
28   *   <li>{@link BusinessDomainDsl.impl.DecimalPropertyImpl#isMaxInclusive <em>Max Inclusive</em>}</li>
29   *   <li>{@link BusinessDomainDsl.impl.DecimalPropertyImpl#getDefaultValue <em>Default Value</em>}</li>
30   * </ul>
31   * </p>
32   *
33   * @generated
34   */
35  public class DecimalPropertyImpl extends PropertyImpl implements DecimalProperty {
36  	/**
37       * The default value of the '{@link #getMinValue() <em>Min Value</em>}' attribute.
38       * <!-- begin-user-doc -->
39  	 * <!-- end-user-doc -->
40       * @see #getMinValue()
41       * @generated
42       * @ordered
43       */
44  	protected static final float MIN_VALUE_EDEFAULT = -2.14748365E9F;
45  
46  	/**
47       * The cached value of the '{@link #getMinValue() <em>Min Value</em>}' attribute.
48       * <!-- begin-user-doc -->
49  	 * <!-- end-user-doc -->
50       * @see #getMinValue()
51       * @generated
52       * @ordered
53       */
54  	protected float minValue = MIN_VALUE_EDEFAULT;
55  
56  	/**
57       * The default value of the '{@link #getMaxValue() <em>Max Value</em>}' attribute.
58       * <!-- begin-user-doc -->
59  	 * <!-- end-user-doc -->
60       * @see #getMaxValue()
61       * @generated
62       * @ordered
63       */
64  	protected static final float MAX_VALUE_EDEFAULT = -2.14748365E9F;
65  
66  	/**
67       * The cached value of the '{@link #getMaxValue() <em>Max Value</em>}' attribute.
68       * <!-- begin-user-doc -->
69  	 * <!-- end-user-doc -->
70       * @see #getMaxValue()
71       * @generated
72       * @ordered
73       */
74  	protected float maxValue = MAX_VALUE_EDEFAULT;
75  
76  	/**
77       * The default value of the '{@link #isMinInclusive() <em>Min Inclusive</em>}' attribute.
78       * <!-- begin-user-doc -->
79  	 * <!-- end-user-doc -->
80       * @see #isMinInclusive()
81       * @generated
82       * @ordered
83       */
84  	protected static final boolean MIN_INCLUSIVE_EDEFAULT = true;
85  
86  	/**
87       * The cached value of the '{@link #isMinInclusive() <em>Min Inclusive</em>}' attribute.
88       * <!-- begin-user-doc -->
89  	 * <!-- end-user-doc -->
90       * @see #isMinInclusive()
91       * @generated
92       * @ordered
93       */
94  	protected boolean minInclusive = MIN_INCLUSIVE_EDEFAULT;
95  
96  	/**
97       * The default value of the '{@link #isMaxInclusive() <em>Max Inclusive</em>}' attribute.
98       * <!-- begin-user-doc -->
99  	 * <!-- end-user-doc -->
100      * @see #isMaxInclusive()
101      * @generated
102      * @ordered
103      */
104 	protected static final boolean MAX_INCLUSIVE_EDEFAULT = true;
105 
106 	/**
107      * The cached value of the '{@link #isMaxInclusive() <em>Max Inclusive</em>}' attribute.
108      * <!-- begin-user-doc -->
109 	 * <!-- end-user-doc -->
110      * @see #isMaxInclusive()
111      * @generated
112      * @ordered
113      */
114 	protected boolean maxInclusive = MAX_INCLUSIVE_EDEFAULT;
115 
116 	/**
117      * The default value of the '{@link #getDefaultValue() <em>Default Value</em>}' attribute.
118      * <!-- begin-user-doc -->
119 	 * <!-- end-user-doc -->
120      * @see #getDefaultValue()
121      * @generated
122      * @ordered
123      */
124 	protected static final float DEFAULT_VALUE_EDEFAULT = 0.0F;
125 
126 	/**
127      * The cached value of the '{@link #getDefaultValue() <em>Default Value</em>}' attribute.
128      * <!-- begin-user-doc -->
129 	 * <!-- end-user-doc -->
130      * @see #getDefaultValue()
131      * @generated
132      * @ordered
133      */
134 	protected float defaultValue = DEFAULT_VALUE_EDEFAULT;
135 
136 	/**
137      * <!-- begin-user-doc -->
138 	 * <!-- end-user-doc -->
139      * @generated
140      */
141 	protected DecimalPropertyImpl() {
142         super();
143     }
144 
145 	/**
146      * <!-- begin-user-doc -->
147 	 * <!-- end-user-doc -->
148      * @generated
149      */
150 	@Override
151 	protected EClass eStaticClass() {
152         return BusinessDomainDslPackage.Literals.DECIMAL_PROPERTY;
153     }
154 
155 	/**
156      * <!-- begin-user-doc -->
157 	 * <!-- end-user-doc -->
158      * @generated
159      */
160 	public float getMinValue() {
161         return minValue;
162     }
163 
164 	/**
165      * <!-- begin-user-doc -->
166 	 * <!-- end-user-doc -->
167      * @generated
168      */
169 	public void setMinValue(float newMinValue) {
170         float oldMinValue = minValue;
171         minValue = newMinValue;
172         if (eNotificationRequired())
173             eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_VALUE, oldMinValue, minValue));
174     }
175 
176 	/**
177      * <!-- begin-user-doc -->
178 	 * <!-- end-user-doc -->
179      * @generated
180      */
181 	public float getMaxValue() {
182         return maxValue;
183     }
184 
185 	/**
186      * <!-- begin-user-doc -->
187 	 * <!-- end-user-doc -->
188      * @generated
189      */
190 	public void setMaxValue(float newMaxValue) {
191         float oldMaxValue = maxValue;
192         maxValue = newMaxValue;
193         if (eNotificationRequired())
194             eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_VALUE, oldMaxValue, maxValue));
195     }
196 
197 	/**
198      * <!-- begin-user-doc -->
199 	 * <!-- end-user-doc -->
200      * @generated
201      */
202 	public boolean isMinInclusive() {
203         return minInclusive;
204     }
205 
206 	/**
207      * <!-- begin-user-doc -->
208 	 * <!-- end-user-doc -->
209      * @generated
210      */
211 	public void setMinInclusive(boolean newMinInclusive) {
212         boolean oldMinInclusive = minInclusive;
213         minInclusive = newMinInclusive;
214         if (eNotificationRequired())
215             eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_INCLUSIVE, oldMinInclusive, minInclusive));
216     }
217 
218 	/**
219      * <!-- begin-user-doc -->
220 	 * <!-- end-user-doc -->
221      * @generated
222      */
223 	public boolean isMaxInclusive() {
224         return maxInclusive;
225     }
226 
227 	/**
228      * <!-- begin-user-doc -->
229 	 * <!-- end-user-doc -->
230      * @generated
231      */
232 	public void setMaxInclusive(boolean newMaxInclusive) {
233         boolean oldMaxInclusive = maxInclusive;
234         maxInclusive = newMaxInclusive;
235         if (eNotificationRequired())
236             eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_INCLUSIVE, oldMaxInclusive, maxInclusive));
237     }
238 
239 	/**
240      * <!-- begin-user-doc -->
241 	 * <!-- end-user-doc -->
242      * @generated
243      */
244 	public float getDefaultValue() {
245         return defaultValue;
246     }
247 
248 	/**
249      * <!-- begin-user-doc -->
250 	 * <!-- end-user-doc -->
251      * @generated
252      */
253 	public void setDefaultValue(float newDefaultValue) {
254         float oldDefaultValue = defaultValue;
255         defaultValue = newDefaultValue;
256         if (eNotificationRequired())
257             eNotify(new ENotificationImpl(this, Notification.SET, BusinessDomainDslPackage.DECIMAL_PROPERTY__DEFAULT_VALUE, oldDefaultValue, defaultValue));
258     }
259 
260 	/**
261      * <!-- begin-user-doc -->
262 	 * <!-- end-user-doc -->
263      * @generated
264      */
265 	@Override
266 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
267         switch (featureID) {
268             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_VALUE:
269                 return getMinValue();
270             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_VALUE:
271                 return getMaxValue();
272             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_INCLUSIVE:
273                 return isMinInclusive();
274             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_INCLUSIVE:
275                 return isMaxInclusive();
276             case BusinessDomainDslPackage.DECIMAL_PROPERTY__DEFAULT_VALUE:
277                 return getDefaultValue();
278         }
279         return super.eGet(featureID, resolve, coreType);
280     }
281 
282 	/**
283      * <!-- begin-user-doc -->
284 	 * <!-- end-user-doc -->
285      * @generated
286      */
287 	@Override
288 	public void eSet(int featureID, Object newValue) {
289         switch (featureID) {
290             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_VALUE:
291                 setMinValue((Float)newValue);
292                 return;
293             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_VALUE:
294                 setMaxValue((Float)newValue);
295                 return;
296             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_INCLUSIVE:
297                 setMinInclusive((Boolean)newValue);
298                 return;
299             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_INCLUSIVE:
300                 setMaxInclusive((Boolean)newValue);
301                 return;
302             case BusinessDomainDslPackage.DECIMAL_PROPERTY__DEFAULT_VALUE:
303                 setDefaultValue((Float)newValue);
304                 return;
305         }
306         super.eSet(featureID, newValue);
307     }
308 
309 	/**
310      * <!-- begin-user-doc -->
311 	 * <!-- end-user-doc -->
312      * @generated
313      */
314 	@Override
315 	public void eUnset(int featureID) {
316         switch (featureID) {
317             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_VALUE:
318                 setMinValue(MIN_VALUE_EDEFAULT);
319                 return;
320             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_VALUE:
321                 setMaxValue(MAX_VALUE_EDEFAULT);
322                 return;
323             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_INCLUSIVE:
324                 setMinInclusive(MIN_INCLUSIVE_EDEFAULT);
325                 return;
326             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_INCLUSIVE:
327                 setMaxInclusive(MAX_INCLUSIVE_EDEFAULT);
328                 return;
329             case BusinessDomainDslPackage.DECIMAL_PROPERTY__DEFAULT_VALUE:
330                 setDefaultValue(DEFAULT_VALUE_EDEFAULT);
331                 return;
332         }
333         super.eUnset(featureID);
334     }
335 
336 	/**
337      * <!-- begin-user-doc -->
338 	 * <!-- end-user-doc -->
339      * @generated
340      */
341 	@Override
342 	public boolean eIsSet(int featureID) {
343         switch (featureID) {
344             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_VALUE:
345                 return minValue != MIN_VALUE_EDEFAULT;
346             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_VALUE:
347                 return maxValue != MAX_VALUE_EDEFAULT;
348             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MIN_INCLUSIVE:
349                 return minInclusive != MIN_INCLUSIVE_EDEFAULT;
350             case BusinessDomainDslPackage.DECIMAL_PROPERTY__MAX_INCLUSIVE:
351                 return maxInclusive != MAX_INCLUSIVE_EDEFAULT;
352             case BusinessDomainDslPackage.DECIMAL_PROPERTY__DEFAULT_VALUE:
353                 return defaultValue != DEFAULT_VALUE_EDEFAULT;
354         }
355         return super.eIsSet(featureID);
356     }
357 
358 	/**
359      * <!-- begin-user-doc -->
360 	 * <!-- end-user-doc -->
361      * @generated
362      */
363 	@Override
364 	public String toString() {
365         if (eIsProxy()) return super.toString();
366 
367         StringBuffer result = new StringBuffer(super.toString());
368         result.append(" (minValue: ");
369         result.append(minValue);
370         result.append(", maxValue: ");
371         result.append(maxValue);
372         result.append(", minInclusive: ");
373         result.append(minInclusive);
374         result.append(", maxInclusive: ");
375         result.append(maxInclusive);
376         result.append(", defaultValue: ");
377         result.append(defaultValue);
378         result.append(')');
379         return result.toString();
380     }
381 
382 } //DecimalPropertyImpl