1 | /**
|
---|
2 | */
|
---|
3 | package de.ugoe.cs.swe.bnftools.ebnf.impl;
|
---|
4 |
|
---|
5 | import de.ugoe.cs.swe.bnftools.ebnf.EbnfPackage;
|
---|
6 | import de.ugoe.cs.swe.bnftools.ebnf.StringRule;
|
---|
7 |
|
---|
8 | import org.eclipse.emf.common.notify.Notification;
|
---|
9 |
|
---|
10 | import org.eclipse.emf.ecore.EClass;
|
---|
11 |
|
---|
12 | import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
---|
13 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * <!-- begin-user-doc -->
|
---|
17 | * An implementation of the model object '<em><b>String Rule</b></em>'.
|
---|
18 | * <!-- end-user-doc -->
|
---|
19 | * <p>
|
---|
20 | * The following features are implemented:
|
---|
21 | * <ul>
|
---|
22 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.StringRuleImpl#getLiteral <em>Literal</em>}</li>
|
---|
23 | * <li>{@link de.ugoe.cs.swe.bnftools.ebnf.impl.StringRuleImpl#getColon <em>Colon</em>}</li>
|
---|
24 | * </ul>
|
---|
25 | * </p>
|
---|
26 | *
|
---|
27 | * @generated
|
---|
28 | */
|
---|
29 | public class StringRuleImpl extends MinimalEObjectImpl.Container implements StringRule
|
---|
30 | {
|
---|
31 | /**
|
---|
32 | * The default value of the '{@link #getLiteral() <em>Literal</em>}' attribute.
|
---|
33 | * <!-- begin-user-doc -->
|
---|
34 | * <!-- end-user-doc -->
|
---|
35 | * @see #getLiteral()
|
---|
36 | * @generated
|
---|
37 | * @ordered
|
---|
38 | */
|
---|
39 | protected static final String LITERAL_EDEFAULT = null;
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * The cached value of the '{@link #getLiteral() <em>Literal</em>}' attribute.
|
---|
43 | * <!-- begin-user-doc -->
|
---|
44 | * <!-- end-user-doc -->
|
---|
45 | * @see #getLiteral()
|
---|
46 | * @generated
|
---|
47 | * @ordered
|
---|
48 | */
|
---|
49 | protected String literal = LITERAL_EDEFAULT;
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * The default value of the '{@link #getColon() <em>Colon</em>}' attribute.
|
---|
53 | * <!-- begin-user-doc -->
|
---|
54 | * <!-- end-user-doc -->
|
---|
55 | * @see #getColon()
|
---|
56 | * @generated
|
---|
57 | * @ordered
|
---|
58 | */
|
---|
59 | protected static final String COLON_EDEFAULT = null;
|
---|
60 |
|
---|
61 | /**
|
---|
62 | * The cached value of the '{@link #getColon() <em>Colon</em>}' attribute.
|
---|
63 | * <!-- begin-user-doc -->
|
---|
64 | * <!-- end-user-doc -->
|
---|
65 | * @see #getColon()
|
---|
66 | * @generated
|
---|
67 | * @ordered
|
---|
68 | */
|
---|
69 | protected String colon = COLON_EDEFAULT;
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * <!-- begin-user-doc -->
|
---|
73 | * <!-- end-user-doc -->
|
---|
74 | * @generated
|
---|
75 | */
|
---|
76 | protected StringRuleImpl()
|
---|
77 | {
|
---|
78 | super();
|
---|
79 | }
|
---|
80 |
|
---|
81 | /**
|
---|
82 | * <!-- begin-user-doc -->
|
---|
83 | * <!-- end-user-doc -->
|
---|
84 | * @generated
|
---|
85 | */
|
---|
86 | @Override
|
---|
87 | protected EClass eStaticClass()
|
---|
88 | {
|
---|
89 | return EbnfPackage.Literals.STRING_RULE;
|
---|
90 | }
|
---|
91 |
|
---|
92 | /**
|
---|
93 | * <!-- begin-user-doc -->
|
---|
94 | * <!-- end-user-doc -->
|
---|
95 | * @generated
|
---|
96 | */
|
---|
97 | public String getLiteral()
|
---|
98 | {
|
---|
99 | return literal;
|
---|
100 | }
|
---|
101 |
|
---|
102 | /**
|
---|
103 | * <!-- begin-user-doc -->
|
---|
104 | * <!-- end-user-doc -->
|
---|
105 | * @generated
|
---|
106 | */
|
---|
107 | public void setLiteral(String newLiteral)
|
---|
108 | {
|
---|
109 | String oldLiteral = literal;
|
---|
110 | literal = newLiteral;
|
---|
111 | if (eNotificationRequired())
|
---|
112 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.STRING_RULE__LITERAL, oldLiteral, literal));
|
---|
113 | }
|
---|
114 |
|
---|
115 | /**
|
---|
116 | * <!-- begin-user-doc -->
|
---|
117 | * <!-- end-user-doc -->
|
---|
118 | * @generated
|
---|
119 | */
|
---|
120 | public String getColon()
|
---|
121 | {
|
---|
122 | return colon;
|
---|
123 | }
|
---|
124 |
|
---|
125 | /**
|
---|
126 | * <!-- begin-user-doc -->
|
---|
127 | * <!-- end-user-doc -->
|
---|
128 | * @generated
|
---|
129 | */
|
---|
130 | public void setColon(String newColon)
|
---|
131 | {
|
---|
132 | String oldColon = colon;
|
---|
133 | colon = newColon;
|
---|
134 | if (eNotificationRequired())
|
---|
135 | eNotify(new ENotificationImpl(this, Notification.SET, EbnfPackage.STRING_RULE__COLON, oldColon, colon));
|
---|
136 | }
|
---|
137 |
|
---|
138 | /**
|
---|
139 | * <!-- begin-user-doc -->
|
---|
140 | * <!-- end-user-doc -->
|
---|
141 | * @generated
|
---|
142 | */
|
---|
143 | @Override
|
---|
144 | public Object eGet(int featureID, boolean resolve, boolean coreType)
|
---|
145 | {
|
---|
146 | switch (featureID)
|
---|
147 | {
|
---|
148 | case EbnfPackage.STRING_RULE__LITERAL:
|
---|
149 | return getLiteral();
|
---|
150 | case EbnfPackage.STRING_RULE__COLON:
|
---|
151 | return getColon();
|
---|
152 | }
|
---|
153 | return super.eGet(featureID, resolve, coreType);
|
---|
154 | }
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * <!-- begin-user-doc -->
|
---|
158 | * <!-- end-user-doc -->
|
---|
159 | * @generated
|
---|
160 | */
|
---|
161 | @Override
|
---|
162 | public void eSet(int featureID, Object newValue)
|
---|
163 | {
|
---|
164 | switch (featureID)
|
---|
165 | {
|
---|
166 | case EbnfPackage.STRING_RULE__LITERAL:
|
---|
167 | setLiteral((String)newValue);
|
---|
168 | return;
|
---|
169 | case EbnfPackage.STRING_RULE__COLON:
|
---|
170 | setColon((String)newValue);
|
---|
171 | return;
|
---|
172 | }
|
---|
173 | super.eSet(featureID, newValue);
|
---|
174 | }
|
---|
175 |
|
---|
176 | /**
|
---|
177 | * <!-- begin-user-doc -->
|
---|
178 | * <!-- end-user-doc -->
|
---|
179 | * @generated
|
---|
180 | */
|
---|
181 | @Override
|
---|
182 | public void eUnset(int featureID)
|
---|
183 | {
|
---|
184 | switch (featureID)
|
---|
185 | {
|
---|
186 | case EbnfPackage.STRING_RULE__LITERAL:
|
---|
187 | setLiteral(LITERAL_EDEFAULT);
|
---|
188 | return;
|
---|
189 | case EbnfPackage.STRING_RULE__COLON:
|
---|
190 | setColon(COLON_EDEFAULT);
|
---|
191 | return;
|
---|
192 | }
|
---|
193 | super.eUnset(featureID);
|
---|
194 | }
|
---|
195 |
|
---|
196 | /**
|
---|
197 | * <!-- begin-user-doc -->
|
---|
198 | * <!-- end-user-doc -->
|
---|
199 | * @generated
|
---|
200 | */
|
---|
201 | @Override
|
---|
202 | public boolean eIsSet(int featureID)
|
---|
203 | {
|
---|
204 | switch (featureID)
|
---|
205 | {
|
---|
206 | case EbnfPackage.STRING_RULE__LITERAL:
|
---|
207 | return LITERAL_EDEFAULT == null ? literal != null : !LITERAL_EDEFAULT.equals(literal);
|
---|
208 | case EbnfPackage.STRING_RULE__COLON:
|
---|
209 | return COLON_EDEFAULT == null ? colon != null : !COLON_EDEFAULT.equals(colon);
|
---|
210 | }
|
---|
211 | return super.eIsSet(featureID);
|
---|
212 | }
|
---|
213 |
|
---|
214 | /**
|
---|
215 | * <!-- begin-user-doc -->
|
---|
216 | * <!-- end-user-doc -->
|
---|
217 | * @generated
|
---|
218 | */
|
---|
219 | @Override
|
---|
220 | public String toString()
|
---|
221 | {
|
---|
222 | if (eIsProxy()) return super.toString();
|
---|
223 |
|
---|
224 | StringBuffer result = new StringBuffer(super.toString());
|
---|
225 | result.append(" (literal: ");
|
---|
226 | result.append(literal);
|
---|
227 | result.append(", colon: ");
|
---|
228 | result.append(colon);
|
---|
229 | result.append(')');
|
---|
230 | return result.toString();
|
---|
231 | }
|
---|
232 |
|
---|
233 | } //StringRuleImpl
|
---|