diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java | 221 |
1 files changed, 221 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java new file mode 100644 index 00000000..4c236e8e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java | |||
@@ -0,0 +1,221 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Model; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.Notification; | ||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
16 | |||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.InternalEObject; | ||
19 | |||
20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
21 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
22 | |||
23 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
24 | import org.eclipse.emf.ecore.util.InternalEList; | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * An implementation of the model object '<em><b>Model</b></em>'. | ||
29 | * <!-- end-user-doc --> | ||
30 | * <p> | ||
31 | * The following features are implemented: | ||
32 | * </p> | ||
33 | * <ul> | ||
34 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl#getFilesystems <em>Filesystems</em>}</li> | ||
35 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.ModelImpl#getOtherFSObjects <em>Other FS Objects</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class ModelImpl extends MinimalEObjectImpl.Container implements Model { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getFilesystems() <em>Filesystems</em>}' containment reference. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getFilesystems() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected FileSystem filesystems; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getOtherFSObjects() <em>Other FS Objects</em>}' containment reference list. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getOtherFSObjects() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected EList<FSObject> otherFSObjects; | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | protected ModelImpl() { | ||
67 | super(); | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | @Override | ||
76 | protected EClass eStaticClass() { | ||
77 | return FilesystemPackage.Literals.MODEL; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | public FileSystem getFilesystems() { | ||
86 | return filesystems; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | public NotificationChain basicSetFilesystems(FileSystem newFilesystems, NotificationChain msgs) { | ||
95 | FileSystem oldFilesystems = filesystems; | ||
96 | filesystems = newFilesystems; | ||
97 | if (eNotificationRequired()) { | ||
98 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.MODEL__FILESYSTEMS, oldFilesystems, newFilesystems); | ||
99 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
100 | } | ||
101 | return msgs; | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | public void setFilesystems(FileSystem newFilesystems) { | ||
110 | if (newFilesystems != filesystems) { | ||
111 | NotificationChain msgs = null; | ||
112 | if (filesystems != null) | ||
113 | msgs = ((InternalEObject)filesystems).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.MODEL__FILESYSTEMS, null, msgs); | ||
114 | if (newFilesystems != null) | ||
115 | msgs = ((InternalEObject)newFilesystems).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.MODEL__FILESYSTEMS, null, msgs); | ||
116 | msgs = basicSetFilesystems(newFilesystems, msgs); | ||
117 | if (msgs != null) msgs.dispatch(); | ||
118 | } | ||
119 | else if (eNotificationRequired()) | ||
120 | eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.MODEL__FILESYSTEMS, newFilesystems, newFilesystems)); | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | public EList<FSObject> getOtherFSObjects() { | ||
129 | if (otherFSObjects == null) { | ||
130 | otherFSObjects = new EObjectContainmentEList<FSObject>(FSObject.class, this, FilesystemPackage.MODEL__OTHER_FS_OBJECTS); | ||
131 | } | ||
132 | return otherFSObjects; | ||
133 | } | ||
134 | |||
135 | /** | ||
136 | * <!-- begin-user-doc --> | ||
137 | * <!-- end-user-doc --> | ||
138 | * @generated | ||
139 | */ | ||
140 | @Override | ||
141 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
142 | switch (featureID) { | ||
143 | case FilesystemPackage.MODEL__FILESYSTEMS: | ||
144 | return basicSetFilesystems(null, msgs); | ||
145 | case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: | ||
146 | return ((InternalEList<?>)getOtherFSObjects()).basicRemove(otherEnd, msgs); | ||
147 | } | ||
148 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
158 | switch (featureID) { | ||
159 | case FilesystemPackage.MODEL__FILESYSTEMS: | ||
160 | return getFilesystems(); | ||
161 | case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: | ||
162 | return getOtherFSObjects(); | ||
163 | } | ||
164 | return super.eGet(featureID, resolve, coreType); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * <!-- begin-user-doc --> | ||
169 | * <!-- end-user-doc --> | ||
170 | * @generated | ||
171 | */ | ||
172 | @SuppressWarnings("unchecked") | ||
173 | @Override | ||
174 | public void eSet(int featureID, Object newValue) { | ||
175 | switch (featureID) { | ||
176 | case FilesystemPackage.MODEL__FILESYSTEMS: | ||
177 | setFilesystems((FileSystem)newValue); | ||
178 | return; | ||
179 | case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: | ||
180 | getOtherFSObjects().clear(); | ||
181 | getOtherFSObjects().addAll((Collection<? extends FSObject>)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 | switch (featureID) { | ||
195 | case FilesystemPackage.MODEL__FILESYSTEMS: | ||
196 | setFilesystems((FileSystem)null); | ||
197 | return; | ||
198 | case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: | ||
199 | getOtherFSObjects().clear(); | ||
200 | return; | ||
201 | } | ||
202 | super.eUnset(featureID); | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * <!-- begin-user-doc --> | ||
207 | * <!-- end-user-doc --> | ||
208 | * @generated | ||
209 | */ | ||
210 | @Override | ||
211 | public boolean eIsSet(int featureID) { | ||
212 | switch (featureID) { | ||
213 | case FilesystemPackage.MODEL__FILESYSTEMS: | ||
214 | return filesystems != null; | ||
215 | case FilesystemPackage.MODEL__OTHER_FS_OBJECTS: | ||
216 | return otherFSObjects != null && !otherFSObjects.isEmpty(); | ||
217 | } | ||
218 | return super.eIsSet(featureID); | ||
219 | } | ||
220 | |||
221 | } //ModelImpl | ||