diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java | 205 |
1 files changed, 205 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java new file mode 100644 index 00000000..adf30f3a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java | |||
@@ -0,0 +1,205 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; | ||
9 | |||
10 | import org.eclipse.emf.common.notify.Notification; | ||
11 | import org.eclipse.emf.common.notify.NotificationChain; | ||
12 | |||
13 | import org.eclipse.emf.common.util.EList; | ||
14 | |||
15 | import org.eclipse.emf.ecore.EClass; | ||
16 | import org.eclipse.emf.ecore.EStructuralFeature; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
20 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
21 | |||
22 | /** | ||
23 | * <!-- begin-user-doc --> | ||
24 | * An implementation of the model object '<em><b>File System</b></em>'. | ||
25 | * <!-- end-user-doc --> | ||
26 | * <p> | ||
27 | * The following features are implemented: | ||
28 | * </p> | ||
29 | * <ul> | ||
30 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getRoot <em>Root</em>}</li> | ||
31 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.FileSystemImpl#getLive <em>Live</em>}</li> | ||
32 | * </ul> | ||
33 | * | ||
34 | * @generated | ||
35 | */ | ||
36 | public class FileSystemImpl extends MinimalEObjectImpl.Container implements FileSystem { | ||
37 | /** | ||
38 | * The cached value of the '{@link #getRoot() <em>Root</em>}' containment reference. | ||
39 | * <!-- begin-user-doc --> | ||
40 | * <!-- end-user-doc --> | ||
41 | * @see #getRoot() | ||
42 | * @generated | ||
43 | * @ordered | ||
44 | */ | ||
45 | protected Dir root; | ||
46 | |||
47 | /** | ||
48 | * The cached setting delegate for the '{@link #getLive() <em>Live</em>}' reference list. | ||
49 | * <!-- begin-user-doc --> | ||
50 | * <!-- end-user-doc --> | ||
51 | * @see #getLive() | ||
52 | * @generated | ||
53 | * @ordered | ||
54 | */ | ||
55 | protected EStructuralFeature.Internal.SettingDelegate LIVE__ESETTING_DELEGATE = ((EStructuralFeature.Internal)FilesystemPackage.Literals.FILE_SYSTEM__LIVE).getSettingDelegate(); | ||
56 | |||
57 | /** | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @generated | ||
61 | */ | ||
62 | protected FileSystemImpl() { | ||
63 | super(); | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | @Override | ||
72 | protected EClass eStaticClass() { | ||
73 | return FilesystemPackage.Literals.FILE_SYSTEM; | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * <!-- begin-user-doc --> | ||
78 | * <!-- end-user-doc --> | ||
79 | * @generated | ||
80 | */ | ||
81 | public Dir getRoot() { | ||
82 | return root; | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | public NotificationChain basicSetRoot(Dir newRoot, NotificationChain msgs) { | ||
91 | Dir oldRoot = root; | ||
92 | root = newRoot; | ||
93 | if (eNotificationRequired()) { | ||
94 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, oldRoot, newRoot); | ||
95 | if (msgs == null) msgs = notification; else msgs.add(notification); | ||
96 | } | ||
97 | return msgs; | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * <!-- begin-user-doc --> | ||
102 | * <!-- end-user-doc --> | ||
103 | * @generated | ||
104 | */ | ||
105 | public void setRoot(Dir newRoot) { | ||
106 | if (newRoot != root) { | ||
107 | NotificationChain msgs = null; | ||
108 | if (root != null) | ||
109 | msgs = ((InternalEObject)root).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs); | ||
110 | if (newRoot != null) | ||
111 | msgs = ((InternalEObject)newRoot).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FilesystemPackage.FILE_SYSTEM__ROOT, null, msgs); | ||
112 | msgs = basicSetRoot(newRoot, msgs); | ||
113 | if (msgs != null) msgs.dispatch(); | ||
114 | } | ||
115 | else if (eNotificationRequired()) | ||
116 | eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, newRoot, newRoot)); | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @generated | ||
123 | */ | ||
124 | @SuppressWarnings("unchecked") | ||
125 | public EList<FSObject> getLive() { | ||
126 | return (EList<FSObject>)LIVE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | ||
127 | } | ||
128 | |||
129 | /** | ||
130 | * <!-- begin-user-doc --> | ||
131 | * <!-- end-user-doc --> | ||
132 | * @generated | ||
133 | */ | ||
134 | @Override | ||
135 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
136 | switch (featureID) { | ||
137 | case FilesystemPackage.FILE_SYSTEM__ROOT: | ||
138 | return basicSetRoot(null, msgs); | ||
139 | } | ||
140 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
141 | } | ||
142 | |||
143 | /** | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | */ | ||
148 | @Override | ||
149 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
150 | switch (featureID) { | ||
151 | case FilesystemPackage.FILE_SYSTEM__ROOT: | ||
152 | return getRoot(); | ||
153 | case FilesystemPackage.FILE_SYSTEM__LIVE: | ||
154 | return getLive(); | ||
155 | } | ||
156 | return super.eGet(featureID, resolve, coreType); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | @Override | ||
165 | public void eSet(int featureID, Object newValue) { | ||
166 | switch (featureID) { | ||
167 | case FilesystemPackage.FILE_SYSTEM__ROOT: | ||
168 | setRoot((Dir)newValue); | ||
169 | return; | ||
170 | } | ||
171 | super.eSet(featureID, newValue); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * <!-- begin-user-doc --> | ||
176 | * <!-- end-user-doc --> | ||
177 | * @generated | ||
178 | */ | ||
179 | @Override | ||
180 | public void eUnset(int featureID) { | ||
181 | switch (featureID) { | ||
182 | case FilesystemPackage.FILE_SYSTEM__ROOT: | ||
183 | setRoot((Dir)null); | ||
184 | return; | ||
185 | } | ||
186 | super.eUnset(featureID); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public boolean eIsSet(int featureID) { | ||
196 | switch (featureID) { | ||
197 | case FilesystemPackage.FILE_SYSTEM__ROOT: | ||
198 | return root != null; | ||
199 | case FilesystemPackage.FILE_SYSTEM__LIVE: | ||
200 | return LIVE__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); | ||
201 | } | ||
202 | return super.eIsSet(featureID); | ||
203 | } | ||
204 | |||
205 | } //FileSystemImpl | ||