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