diff options
author | 2017-08-20 01:55:38 +0200 | |
---|---|---|
committer | 2017-08-20 01:55:38 +0200 | |
commit | 78c806eebaf5b9d50b08768062755f0044cf107f (patch) | |
tree | 7db4d1b6a990b2572ed82a747dffac65a1c6fcc5 /Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java | |
parent | null check before mapping value of a reference (diff) | |
download | VIATRA-Generator-78c806eebaf5b9d50b08768062755f0044cf107f.tar.gz VIATRA-Generator-78c806eebaf5b9d50b08768062755f0044cf107f.tar.zst VIATRA-Generator-78c806eebaf5b9d50b08768062755f0044cf107f.zip |
Alloy Examples
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java | 165 |
1 files changed, 165 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java new file mode 100644 index 00000000..62df04af --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java | |||
@@ -0,0 +1,165 @@ | |||
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.FilesystemPackage; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
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.InternalEObject; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | /** | ||
22 | * <!-- begin-user-doc --> | ||
23 | * An implementation of the model object '<em><b>Dir</b></em>'. | ||
24 | * <!-- end-user-doc --> | ||
25 | * <p> | ||
26 | * The following features are implemented: | ||
27 | * </p> | ||
28 | * <ul> | ||
29 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl.DirImpl#getContents <em>Contents</em>}</li> | ||
30 | * </ul> | ||
31 | * | ||
32 | * @generated | ||
33 | */ | ||
34 | public class DirImpl extends FSObjectImpl implements Dir { | ||
35 | /** | ||
36 | * The cached value of the '{@link #getContents() <em>Contents</em>}' containment reference list. | ||
37 | * <!-- begin-user-doc --> | ||
38 | * <!-- end-user-doc --> | ||
39 | * @see #getContents() | ||
40 | * @generated | ||
41 | * @ordered | ||
42 | */ | ||
43 | protected EList<FSObject> contents; | ||
44 | |||
45 | /** | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @generated | ||
49 | */ | ||
50 | protected DirImpl() { | ||
51 | super(); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * <!-- begin-user-doc --> | ||
56 | * <!-- end-user-doc --> | ||
57 | * @generated | ||
58 | */ | ||
59 | @Override | ||
60 | protected EClass eStaticClass() { | ||
61 | return FilesystemPackage.Literals.DIR; | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @generated | ||
68 | */ | ||
69 | public EList<FSObject> getContents() { | ||
70 | if (contents == null) { | ||
71 | contents = new EObjectContainmentWithInverseEList<FSObject>(FSObject.class, this, FilesystemPackage.DIR__CONTENTS, FilesystemPackage.FS_OBJECT__PARENT); | ||
72 | } | ||
73 | return contents; | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * <!-- begin-user-doc --> | ||
78 | * <!-- end-user-doc --> | ||
79 | * @generated | ||
80 | */ | ||
81 | @SuppressWarnings("unchecked") | ||
82 | @Override | ||
83 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
84 | switch (featureID) { | ||
85 | case FilesystemPackage.DIR__CONTENTS: | ||
86 | return ((InternalEList<InternalEObject>)(InternalEList<?>)getContents()).basicAdd(otherEnd, msgs); | ||
87 | } | ||
88 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
89 | } | ||
90 | |||
91 | /** | ||
92 | * <!-- begin-user-doc --> | ||
93 | * <!-- end-user-doc --> | ||
94 | * @generated | ||
95 | */ | ||
96 | @Override | ||
97 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
98 | switch (featureID) { | ||
99 | case FilesystemPackage.DIR__CONTENTS: | ||
100 | return ((InternalEList<?>)getContents()).basicRemove(otherEnd, msgs); | ||
101 | } | ||
102 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @generated | ||
109 | */ | ||
110 | @Override | ||
111 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
112 | switch (featureID) { | ||
113 | case FilesystemPackage.DIR__CONTENTS: | ||
114 | return getContents(); | ||
115 | } | ||
116 | return super.eGet(featureID, resolve, coreType); | ||
117 | } | ||
118 | |||
119 | /** | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @generated | ||
123 | */ | ||
124 | @SuppressWarnings("unchecked") | ||
125 | @Override | ||
126 | public void eSet(int featureID, Object newValue) { | ||
127 | switch (featureID) { | ||
128 | case FilesystemPackage.DIR__CONTENTS: | ||
129 | getContents().clear(); | ||
130 | getContents().addAll((Collection<? extends FSObject>)newValue); | ||
131 | return; | ||
132 | } | ||
133 | super.eSet(featureID, newValue); | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * <!-- begin-user-doc --> | ||
138 | * <!-- end-user-doc --> | ||
139 | * @generated | ||
140 | */ | ||
141 | @Override | ||
142 | public void eUnset(int featureID) { | ||
143 | switch (featureID) { | ||
144 | case FilesystemPackage.DIR__CONTENTS: | ||
145 | getContents().clear(); | ||
146 | return; | ||
147 | } | ||
148 | super.eUnset(featureID); | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public boolean eIsSet(int featureID) { | ||
158 | switch (featureID) { | ||
159 | case FilesystemPackage.DIR__CONTENTS: | ||
160 | return contents != null && !contents.isEmpty(); | ||
161 | } | ||
162 | return super.eIsSet(featureID); | ||
163 | } | ||
164 | |||
165 | } //DirImpl | ||