source: branches/xtext-MDT/org.modelica.xtext/src-gen/org/modelica/xtext/modelicaBase/impl/ForEquationClauseImpl.java @ 540

Last change on this file since 540 was 540, checked in by nasko, 15 years ago

Added subfolders/files of org.modelica.xtext

File size: 6.1 KB
Line 
1/**
2 * <copyright>
3 * </copyright>
4 *
5 */
6package org.modelica.xtext.modelicaBase.impl;
7
8import java.util.Collection;
9
10import org.eclipse.emf.common.notify.Notification;
11import org.eclipse.emf.common.notify.NotificationChain;
12
13import org.eclipse.emf.common.util.EList;
14
15import org.eclipse.emf.ecore.EClass;
16import org.eclipse.emf.ecore.InternalEObject;
17
18import org.eclipse.emf.ecore.impl.ENotificationImpl;
19
20import org.eclipse.emf.ecore.util.EObjectContainmentEList;
21import org.eclipse.emf.ecore.util.InternalEList;
22
23import org.modelica.xtext.modelicaBase.ForEquationClause;
24import org.modelica.xtext.modelicaBase.ModelicaBasePackage;
25import org.modelica.xtext.modelicaBase.equation_rule;
26
27/**
28 * <!-- begin-user-doc -->
29 * An implementation of the model object '<em><b>For Equation Clause</b></em>'.
30 * <!-- end-user-doc -->
31 * <p>
32 * The following features are implemented:
33 * <ul>
34 *   <li>{@link org.modelica.xtext.modelicaBase.impl.ForEquationClauseImpl#getForIndices <em>For Indices</em>}</li>
35 *   <li>{@link org.modelica.xtext.modelicaBase.impl.ForEquationClauseImpl#getEquationClauses <em>Equation Clauses</em>}</li>
36 * </ul>
37 * </p>
38 *
39 * @generated
40 */
41public class ForEquationClauseImpl extends equation_ruleImpl implements ForEquationClause
42{
43  /**
44   * The default value of the '{@link #getForIndices() <em>For Indices</em>}' attribute.
45   * <!-- begin-user-doc -->
46   * <!-- end-user-doc -->
47   * @see #getForIndices()
48   * @generated
49   * @ordered
50   */
51  protected static final String FOR_INDICES_EDEFAULT = null;
52
53  /**
54   * The cached value of the '{@link #getForIndices() <em>For Indices</em>}' attribute.
55   * <!-- begin-user-doc -->
56   * <!-- end-user-doc -->
57   * @see #getForIndices()
58   * @generated
59   * @ordered
60   */
61  protected String forIndices = FOR_INDICES_EDEFAULT;
62
63  /**
64   * The cached value of the '{@link #getEquationClauses() <em>Equation Clauses</em>}' containment reference list.
65   * <!-- begin-user-doc -->
66   * <!-- end-user-doc -->
67   * @see #getEquationClauses()
68   * @generated
69   * @ordered
70   */
71  protected EList<equation_rule> equationClauses;
72
73  /**
74   * <!-- begin-user-doc -->
75   * <!-- end-user-doc -->
76   * @generated
77   */
78  protected ForEquationClauseImpl()
79  {
80    super();
81  }
82
83  /**
84   * <!-- begin-user-doc -->
85   * <!-- end-user-doc -->
86   * @generated
87   */
88  @Override
89  protected EClass eStaticClass()
90  {
91    return ModelicaBasePackage.Literals.FOR_EQUATION_CLAUSE;
92  }
93
94  /**
95   * <!-- begin-user-doc -->
96   * <!-- end-user-doc -->
97   * @generated
98   */
99  public String getForIndices()
100  {
101    return forIndices;
102  }
103
104  /**
105   * <!-- begin-user-doc -->
106   * <!-- end-user-doc -->
107   * @generated
108   */
109  public void setForIndices(String newForIndices)
110  {
111    String oldForIndices = forIndices;
112    forIndices = newForIndices;
113    if (eNotificationRequired())
114      eNotify(new ENotificationImpl(this, Notification.SET, ModelicaBasePackage.FOR_EQUATION_CLAUSE__FOR_INDICES, oldForIndices, forIndices));
115  }
116
117  /**
118   * <!-- begin-user-doc -->
119   * <!-- end-user-doc -->
120   * @generated
121   */
122  public EList<equation_rule> getEquationClauses()
123  {
124    if (equationClauses == null)
125    {
126      equationClauses = new EObjectContainmentEList<equation_rule>(equation_rule.class, this, ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES);
127    }
128    return equationClauses;
129  }
130
131  /**
132   * <!-- begin-user-doc -->
133   * <!-- end-user-doc -->
134   * @generated
135   */
136  @Override
137  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
138  {
139    switch (featureID)
140    {
141      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES:
142        return ((InternalEList<?>)getEquationClauses()).basicRemove(otherEnd, msgs);
143    }
144    return super.eInverseRemove(otherEnd, featureID, msgs);
145  }
146
147  /**
148   * <!-- begin-user-doc -->
149   * <!-- end-user-doc -->
150   * @generated
151   */
152  @Override
153  public Object eGet(int featureID, boolean resolve, boolean coreType)
154  {
155    switch (featureID)
156    {
157      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__FOR_INDICES:
158        return getForIndices();
159      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES:
160        return getEquationClauses();
161    }
162    return super.eGet(featureID, resolve, coreType);
163  }
164
165  /**
166   * <!-- begin-user-doc -->
167   * <!-- end-user-doc -->
168   * @generated
169   */
170  @SuppressWarnings("unchecked")
171  @Override
172  public void eSet(int featureID, Object newValue)
173  {
174    switch (featureID)
175    {
176      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__FOR_INDICES:
177        setForIndices((String)newValue);
178        return;
179      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES:
180        getEquationClauses().clear();
181        getEquationClauses().addAll((Collection<? extends equation_rule>)newValue);
182        return;
183    }
184    super.eSet(featureID, newValue);
185  }
186
187  /**
188   * <!-- begin-user-doc -->
189   * <!-- end-user-doc -->
190   * @generated
191   */
192  @Override
193  public void eUnset(int featureID)
194  {
195    switch (featureID)
196    {
197      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__FOR_INDICES:
198        setForIndices(FOR_INDICES_EDEFAULT);
199        return;
200      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES:
201        getEquationClauses().clear();
202        return;
203    }
204    super.eUnset(featureID);
205  }
206
207  /**
208   * <!-- begin-user-doc -->
209   * <!-- end-user-doc -->
210   * @generated
211   */
212  @Override
213  public boolean eIsSet(int featureID)
214  {
215    switch (featureID)
216    {
217      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__FOR_INDICES:
218        return FOR_INDICES_EDEFAULT == null ? forIndices != null : !FOR_INDICES_EDEFAULT.equals(forIndices);
219      case ModelicaBasePackage.FOR_EQUATION_CLAUSE__EQUATION_CLAUSES:
220        return equationClauses != null && !equationClauses.isEmpty();
221    }
222    return super.eIsSet(featureID);
223  }
224
225  /**
226   * <!-- begin-user-doc -->
227   * <!-- end-user-doc -->
228   * @generated
229   */
230  @Override
231  public String toString()
232  {
233    if (eIsProxy()) return super.toString();
234
235    StringBuffer result = new StringBuffer(super.toString());
236    result.append(" (forIndices: ");
237    result.append(forIndices);
238    result.append(')');
239    return result.toString();
240  }
241
242} //ForEquationClauseImpl
Note: See TracBrowser for help on using the repository browser.