3 package org.opendaylight.nemo.tool.eclipse.plugin.editor.impl;
5 import java.util.Collection;
7 import org.eclipse.emf.common.notify.NotificationChain;
9 import org.eclipse.emf.common.util.EList;
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.InternalEObject;
14 import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
16 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
17 import org.eclipse.emf.ecore.util.InternalEList;
19 import org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorPackage;
20 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Model;
21 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Sentence;
24 * <!-- begin-user-doc -->
25 * An implementation of the model object '<em><b>Model</b></em>'.
26 * <!-- end-user-doc -->
28 * The following features are implemented:
31 * <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.ModelImpl#getSentences <em>Sentences</em>}</li>
36 public class ModelImpl extends MinimalEObjectImpl.Container implements Model
39 * The cached value of the '{@link #getSentences() <em>Sentences</em>}' containment reference list.
40 * <!-- begin-user-doc -->
41 * <!-- end-user-doc -->
42 * @see #getSentences()
46 protected EList<Sentence> sentences;
49 * <!-- begin-user-doc -->
50 * <!-- end-user-doc -->
59 * <!-- begin-user-doc -->
60 * <!-- end-user-doc -->
64 protected EClass eStaticClass()
66 return EditorPackage.Literals.MODEL;
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
74 public EList<Sentence> getSentences()
76 if (sentences == null)
78 sentences = new EObjectContainmentEList<Sentence>(Sentence.class, this, EditorPackage.MODEL__SENTENCES);
84 * <!-- begin-user-doc -->
85 * <!-- end-user-doc -->
89 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
93 case EditorPackage.MODEL__SENTENCES:
94 return ((InternalEList<?>)getSentences()).basicRemove(otherEnd, msgs);
96 return super.eInverseRemove(otherEnd, featureID, msgs);
100 * <!-- begin-user-doc -->
101 * <!-- end-user-doc -->
105 public Object eGet(int featureID, boolean resolve, boolean coreType)
109 case EditorPackage.MODEL__SENTENCES:
110 return getSentences();
112 return super.eGet(featureID, resolve, coreType);
116 * <!-- begin-user-doc -->
117 * <!-- end-user-doc -->
120 @SuppressWarnings("unchecked")
122 public void eSet(int featureID, Object newValue)
126 case EditorPackage.MODEL__SENTENCES:
127 getSentences().clear();
128 getSentences().addAll((Collection<? extends Sentence>)newValue);
131 super.eSet(featureID, newValue);
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
140 public void eUnset(int featureID)
144 case EditorPackage.MODEL__SENTENCES:
145 getSentences().clear();
148 super.eUnset(featureID);
152 * <!-- begin-user-doc -->
153 * <!-- end-user-doc -->
157 public boolean eIsSet(int featureID)
161 case EditorPackage.MODEL__SENTENCES:
162 return sentences != null && !sentences.isEmpty();
164 return super.eIsSet(featureID);