diff options
author | 2020-11-03 22:52:26 -0500 | |
---|---|---|
committer | 2020-11-03 22:52:26 -0500 | |
commit | 945f487a08b643392a5d5918c631640b9a0e4605 (patch) | |
tree | b537c456e395950ce98daaabb9468c7c17d5a72b /Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl | |
parent | Fix numeric-solver-at-end (diff) | |
download | VIATRA-Generator-945f487a08b643392a5d5918c631640b9a0e4605.tar.gz VIATRA-Generator-945f487a08b643392a5d5918c631640b9a0e4605.tar.zst VIATRA-Generator-945f487a08b643392a5d5918c631640b9a0e4605.zip |
add realistic solver
Diffstat (limited to 'Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl')
4 files changed, 814 insertions, 0 deletions
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java new file mode 100644 index 00000000..d8bab731 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java | |||
@@ -0,0 +1,208 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | |||
9 | import org.eclipse.emf.common.util.EList; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | |||
13 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
14 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
15 | |||
16 | import org.eclipse.emf.ecore.util.EObjectResolvingEList; | ||
17 | |||
18 | import socialnetwork.Person; | ||
19 | import socialnetwork.SocialnetworkPackage; | ||
20 | |||
21 | /** | ||
22 | * <!-- begin-user-doc --> | ||
23 | * An implementation of the model object '<em><b>Person</b></em>'. | ||
24 | * <!-- end-user-doc --> | ||
25 | * <p> | ||
26 | * The following features are implemented: | ||
27 | * </p> | ||
28 | * <ul> | ||
29 | * <li>{@link socialnetwork.impl.PersonImpl#getFriends <em>Friends</em>}</li> | ||
30 | * <li>{@link socialnetwork.impl.PersonImpl#getName <em>Name</em>}</li> | ||
31 | * </ul> | ||
32 | * | ||
33 | * @generated | ||
34 | */ | ||
35 | public class PersonImpl extends MinimalEObjectImpl.Container implements Person { | ||
36 | /** | ||
37 | * The cached value of the '{@link #getFriends() <em>Friends</em>}' reference list. | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @see #getFriends() | ||
41 | * @generated | ||
42 | * @ordered | ||
43 | */ | ||
44 | protected EList<Person> friends; | ||
45 | |||
46 | /** | ||
47 | * The default value of the '{@link #getName() <em>Name</em>}' attribute. | ||
48 | * <!-- begin-user-doc --> | ||
49 | * <!-- end-user-doc --> | ||
50 | * @see #getName() | ||
51 | * @generated | ||
52 | * @ordered | ||
53 | */ | ||
54 | protected static final String NAME_EDEFAULT = "Name"; | ||
55 | |||
56 | /** | ||
57 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute. | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @see #getName() | ||
61 | * @generated | ||
62 | * @ordered | ||
63 | */ | ||
64 | protected String name = NAME_EDEFAULT; | ||
65 | |||
66 | /** | ||
67 | * <!-- begin-user-doc --> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @generated | ||
70 | */ | ||
71 | protected PersonImpl() { | ||
72 | super(); | ||
73 | } | ||
74 | |||
75 | /** | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @generated | ||
79 | */ | ||
80 | @Override | ||
81 | protected EClass eStaticClass() { | ||
82 | return SocialnetworkPackage.Literals.PERSON; | ||
83 | } | ||
84 | |||
85 | /** | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | @Override | ||
91 | public EList<Person> getFriends() { | ||
92 | if (friends == null) { | ||
93 | friends = new EObjectResolvingEList<Person>(Person.class, this, SocialnetworkPackage.PERSON__FRIENDS); | ||
94 | } | ||
95 | return friends; | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | @Override | ||
104 | public String getName() { | ||
105 | return name; | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * <!-- begin-user-doc --> | ||
110 | * <!-- end-user-doc --> | ||
111 | * @generated | ||
112 | */ | ||
113 | @Override | ||
114 | public void setName(String newName) { | ||
115 | String oldName = name; | ||
116 | name = newName; | ||
117 | if (eNotificationRequired()) | ||
118 | eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.PERSON__NAME, oldName, name)); | ||
119 | } | ||
120 | |||
121 | /** | ||
122 | * <!-- begin-user-doc --> | ||
123 | * <!-- end-user-doc --> | ||
124 | * @generated | ||
125 | */ | ||
126 | @Override | ||
127 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
128 | switch (featureID) { | ||
129 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
130 | return getFriends(); | ||
131 | case SocialnetworkPackage.PERSON__NAME: | ||
132 | return getName(); | ||
133 | } | ||
134 | return super.eGet(featureID, resolve, coreType); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | @SuppressWarnings("unchecked") | ||
143 | @Override | ||
144 | public void eSet(int featureID, Object newValue) { | ||
145 | switch (featureID) { | ||
146 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
147 | getFriends().clear(); | ||
148 | getFriends().addAll((Collection<? extends Person>) newValue); | ||
149 | return; | ||
150 | case SocialnetworkPackage.PERSON__NAME: | ||
151 | setName((String) newValue); | ||
152 | return; | ||
153 | } | ||
154 | super.eSet(featureID, newValue); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @Override | ||
163 | public void eUnset(int featureID) { | ||
164 | switch (featureID) { | ||
165 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
166 | getFriends().clear(); | ||
167 | return; | ||
168 | case SocialnetworkPackage.PERSON__NAME: | ||
169 | setName(NAME_EDEFAULT); | ||
170 | return; | ||
171 | } | ||
172 | super.eUnset(featureID); | ||
173 | } | ||
174 | |||
175 | /** | ||
176 | * <!-- begin-user-doc --> | ||
177 | * <!-- end-user-doc --> | ||
178 | * @generated | ||
179 | */ | ||
180 | @Override | ||
181 | public boolean eIsSet(int featureID) { | ||
182 | switch (featureID) { | ||
183 | case SocialnetworkPackage.PERSON__FRIENDS: | ||
184 | return friends != null && !friends.isEmpty(); | ||
185 | case SocialnetworkPackage.PERSON__NAME: | ||
186 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | ||
187 | } | ||
188 | return super.eIsSet(featureID); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * <!-- begin-user-doc --> | ||
193 | * <!-- end-user-doc --> | ||
194 | * @generated | ||
195 | */ | ||
196 | @Override | ||
197 | public String toString() { | ||
198 | if (eIsProxy()) | ||
199 | return super.toString(); | ||
200 | |||
201 | StringBuilder result = new StringBuilder(super.toString()); | ||
202 | result.append(" (name: "); | ||
203 | result.append(name); | ||
204 | result.append(')'); | ||
205 | return result.toString(); | ||
206 | } | ||
207 | |||
208 | } //PersonImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java new file mode 100644 index 00000000..cb28b749 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java | |||
@@ -0,0 +1,228 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | import org.eclipse.emf.common.notify.NotificationChain; | ||
9 | |||
10 | import org.eclipse.emf.common.util.EList; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | import socialnetwork.Person; | ||
22 | import socialnetwork.SocialNetwork; | ||
23 | import socialnetwork.SocialnetworkPackage; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Social Network</b></em>'. | ||
28 | * <!-- end-user-doc --> | ||
29 | * <p> | ||
30 | * The following features are implemented: | ||
31 | * </p> | ||
32 | * <ul> | ||
33 | * <li>{@link socialnetwork.impl.SocialNetworkImpl#getName <em>Name</em>}</li> | ||
34 | * <li>{@link socialnetwork.impl.SocialNetworkImpl#getPersons <em>Persons</em>}</li> | ||
35 | * </ul> | ||
36 | * | ||
37 | * @generated | ||
38 | */ | ||
39 | public class SocialNetworkImpl extends MinimalEObjectImpl.Container implements SocialNetwork { | ||
40 | /** | ||
41 | * The default value of the '{@link #getName() <em>Name</em>}' attribute. | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @see #getName() | ||
45 | * @generated | ||
46 | * @ordered | ||
47 | */ | ||
48 | protected static final String NAME_EDEFAULT = "SocialNetwork"; | ||
49 | |||
50 | /** | ||
51 | * The cached value of the '{@link #getName() <em>Name</em>}' attribute. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @see #getName() | ||
55 | * @generated | ||
56 | * @ordered | ||
57 | */ | ||
58 | protected String name = NAME_EDEFAULT; | ||
59 | |||
60 | /** | ||
61 | * The cached value of the '{@link #getPersons() <em>Persons</em>}' containment reference list. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @see #getPersons() | ||
65 | * @generated | ||
66 | * @ordered | ||
67 | */ | ||
68 | protected EList<Person> persons; | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | protected SocialNetworkImpl() { | ||
76 | super(); | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | protected EClass eStaticClass() { | ||
86 | return SocialnetworkPackage.Literals.SOCIAL_NETWORK; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | public String getName() { | ||
96 | return name; | ||
97 | } | ||
98 | |||
99 | /** | ||
100 | * <!-- begin-user-doc --> | ||
101 | * <!-- end-user-doc --> | ||
102 | * @generated | ||
103 | */ | ||
104 | @Override | ||
105 | public void setName(String newName) { | ||
106 | String oldName = name; | ||
107 | name = newName; | ||
108 | if (eNotificationRequired()) | ||
109 | eNotify(new ENotificationImpl(this, Notification.SET, SocialnetworkPackage.SOCIAL_NETWORK__NAME, oldName, | ||
110 | name)); | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * <!-- begin-user-doc --> | ||
115 | * <!-- end-user-doc --> | ||
116 | * @generated | ||
117 | */ | ||
118 | @Override | ||
119 | public EList<Person> getPersons() { | ||
120 | if (persons == null) { | ||
121 | persons = new EObjectContainmentEList<Person>(Person.class, this, | ||
122 | SocialnetworkPackage.SOCIAL_NETWORK__PERSONS); | ||
123 | } | ||
124 | return persons; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * <!-- begin-user-doc --> | ||
129 | * <!-- end-user-doc --> | ||
130 | * @generated | ||
131 | */ | ||
132 | @Override | ||
133 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
134 | switch (featureID) { | ||
135 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
136 | return ((InternalEList<?>) getPersons()).basicRemove(otherEnd, msgs); | ||
137 | } | ||
138 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
139 | } | ||
140 | |||
141 | /** | ||
142 | * <!-- begin-user-doc --> | ||
143 | * <!-- end-user-doc --> | ||
144 | * @generated | ||
145 | */ | ||
146 | @Override | ||
147 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
148 | switch (featureID) { | ||
149 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
150 | return getName(); | ||
151 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
152 | return getPersons(); | ||
153 | } | ||
154 | return super.eGet(featureID, resolve, coreType); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * <!-- begin-user-doc --> | ||
159 | * <!-- end-user-doc --> | ||
160 | * @generated | ||
161 | */ | ||
162 | @SuppressWarnings("unchecked") | ||
163 | @Override | ||
164 | public void eSet(int featureID, Object newValue) { | ||
165 | switch (featureID) { | ||
166 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
167 | setName((String) newValue); | ||
168 | return; | ||
169 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
170 | getPersons().clear(); | ||
171 | getPersons().addAll((Collection<? extends Person>) newValue); | ||
172 | return; | ||
173 | } | ||
174 | super.eSet(featureID, newValue); | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * <!-- begin-user-doc --> | ||
179 | * <!-- end-user-doc --> | ||
180 | * @generated | ||
181 | */ | ||
182 | @Override | ||
183 | public void eUnset(int featureID) { | ||
184 | switch (featureID) { | ||
185 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
186 | setName(NAME_EDEFAULT); | ||
187 | return; | ||
188 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
189 | getPersons().clear(); | ||
190 | return; | ||
191 | } | ||
192 | super.eUnset(featureID); | ||
193 | } | ||
194 | |||
195 | /** | ||
196 | * <!-- begin-user-doc --> | ||
197 | * <!-- end-user-doc --> | ||
198 | * @generated | ||
199 | */ | ||
200 | @Override | ||
201 | public boolean eIsSet(int featureID) { | ||
202 | switch (featureID) { | ||
203 | case SocialnetworkPackage.SOCIAL_NETWORK__NAME: | ||
204 | return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); | ||
205 | case SocialnetworkPackage.SOCIAL_NETWORK__PERSONS: | ||
206 | return persons != null && !persons.isEmpty(); | ||
207 | } | ||
208 | return super.eIsSet(featureID); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * <!-- begin-user-doc --> | ||
213 | * <!-- end-user-doc --> | ||
214 | * @generated | ||
215 | */ | ||
216 | @Override | ||
217 | public String toString() { | ||
218 | if (eIsProxy()) | ||
219 | return super.toString(); | ||
220 | |||
221 | StringBuilder result = new StringBuilder(super.toString()); | ||
222 | result.append(" (name: "); | ||
223 | result.append(name); | ||
224 | result.append(')'); | ||
225 | return result.toString(); | ||
226 | } | ||
227 | |||
228 | } //SocialNetworkImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java new file mode 100644 index 00000000..87fa3a87 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkFactoryImpl.java | |||
@@ -0,0 +1,111 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EObject; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
10 | |||
11 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
12 | |||
13 | import socialnetwork.*; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class SocialnetworkFactoryImpl extends EFactoryImpl implements SocialnetworkFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static SocialnetworkFactory init() { | ||
29 | try { | ||
30 | SocialnetworkFactory theSocialnetworkFactory = (SocialnetworkFactory) EPackage.Registry.INSTANCE | ||
31 | .getEFactory(SocialnetworkPackage.eNS_URI); | ||
32 | if (theSocialnetworkFactory != null) { | ||
33 | return theSocialnetworkFactory; | ||
34 | } | ||
35 | } catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new SocialnetworkFactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public SocialnetworkFactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case SocialnetworkPackage.SOCIAL_NETWORK: | ||
60 | return createSocialNetwork(); | ||
61 | case SocialnetworkPackage.PERSON: | ||
62 | return createPerson(); | ||
63 | default: | ||
64 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
65 | } | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @generated | ||
72 | */ | ||
73 | @Override | ||
74 | public SocialNetwork createSocialNetwork() { | ||
75 | SocialNetworkImpl socialNetwork = new SocialNetworkImpl(); | ||
76 | return socialNetwork; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | */ | ||
84 | @Override | ||
85 | public Person createPerson() { | ||
86 | PersonImpl person = new PersonImpl(); | ||
87 | return person; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | @Override | ||
96 | public SocialnetworkPackage getSocialnetworkPackage() { | ||
97 | return (SocialnetworkPackage) getEPackage(); | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * <!-- begin-user-doc --> | ||
102 | * <!-- end-user-doc --> | ||
103 | * @deprecated | ||
104 | * @generated | ||
105 | */ | ||
106 | @Deprecated | ||
107 | public static SocialnetworkPackage getPackage() { | ||
108 | return SocialnetworkPackage.eINSTANCE; | ||
109 | } | ||
110 | |||
111 | } //SocialnetworkFactoryImpl | ||
diff --git a/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java new file mode 100644 index 00000000..7588df50 --- /dev/null +++ b/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialnetworkPackageImpl.java | |||
@@ -0,0 +1,267 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package socialnetwork.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EAttribute; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | import org.eclipse.emf.ecore.EReference; | ||
9 | |||
10 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
11 | |||
12 | import socialnetwork.Person; | ||
13 | import socialnetwork.SocialNetwork; | ||
14 | import socialnetwork.SocialnetworkFactory; | ||
15 | import socialnetwork.SocialnetworkPackage; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model <b>Package</b>. | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | public class SocialnetworkPackageImpl extends EPackageImpl implements SocialnetworkPackage { | ||
24 | /** | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | private EClass socialNetworkEClass = null; | ||
30 | |||
31 | /** | ||
32 | * <!-- begin-user-doc --> | ||
33 | * <!-- end-user-doc --> | ||
34 | * @generated | ||
35 | */ | ||
36 | private EClass personEClass = null; | ||
37 | |||
38 | /** | ||
39 | * Creates an instance of the model <b>Package</b>, registered with | ||
40 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
41 | * package URI value. | ||
42 | * <p>Note: the correct way to create the package is via the static | ||
43 | * factory method {@link #init init()}, which also performs | ||
44 | * initialization of the package, or returns the registered package, | ||
45 | * if one already exists. | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
49 | * @see socialnetwork.SocialnetworkPackage#eNS_URI | ||
50 | * @see #init() | ||
51 | * @generated | ||
52 | */ | ||
53 | private SocialnetworkPackageImpl() { | ||
54 | super(eNS_URI, SocialnetworkFactory.eINSTANCE); | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * <!-- begin-user-doc --> | ||
59 | * <!-- end-user-doc --> | ||
60 | * @generated | ||
61 | */ | ||
62 | private static boolean isInited = false; | ||
63 | |||
64 | /** | ||
65 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
66 | * | ||
67 | * <p>This method is used to initialize {@link SocialnetworkPackage#eINSTANCE} when that field is accessed. | ||
68 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
69 | * <!-- begin-user-doc --> | ||
70 | * <!-- end-user-doc --> | ||
71 | * @see #eNS_URI | ||
72 | * @see #createPackageContents() | ||
73 | * @see #initializePackageContents() | ||
74 | * @generated | ||
75 | */ | ||
76 | public static SocialnetworkPackage init() { | ||
77 | if (isInited) | ||
78 | return (SocialnetworkPackage) EPackage.Registry.INSTANCE.getEPackage(SocialnetworkPackage.eNS_URI); | ||
79 | |||
80 | // Obtain or create and register package | ||
81 | Object registeredSocialnetworkPackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
82 | SocialnetworkPackageImpl theSocialnetworkPackage = registeredSocialnetworkPackage instanceof SocialnetworkPackageImpl | ||
83 | ? (SocialnetworkPackageImpl) registeredSocialnetworkPackage | ||
84 | : new SocialnetworkPackageImpl(); | ||
85 | |||
86 | isInited = true; | ||
87 | |||
88 | // Create package meta-data objects | ||
89 | theSocialnetworkPackage.createPackageContents(); | ||
90 | |||
91 | // Initialize created meta-data | ||
92 | theSocialnetworkPackage.initializePackageContents(); | ||
93 | |||
94 | // Mark meta-data to indicate it can't be changed | ||
95 | theSocialnetworkPackage.freeze(); | ||
96 | |||
97 | // Update the registry and return the package | ||
98 | EPackage.Registry.INSTANCE.put(SocialnetworkPackage.eNS_URI, theSocialnetworkPackage); | ||
99 | return theSocialnetworkPackage; | ||
100 | } | ||
101 | |||
102 | /** | ||
103 | * <!-- begin-user-doc --> | ||
104 | * <!-- end-user-doc --> | ||
105 | * @generated | ||
106 | */ | ||
107 | @Override | ||
108 | public EClass getSocialNetwork() { | ||
109 | return socialNetworkEClass; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public EAttribute getSocialNetwork_Name() { | ||
119 | return (EAttribute) socialNetworkEClass.getEStructuralFeatures().get(0); | ||
120 | } | ||
121 | |||
122 | /** | ||
123 | * <!-- begin-user-doc --> | ||
124 | * <!-- end-user-doc --> | ||
125 | * @generated | ||
126 | */ | ||
127 | @Override | ||
128 | public EReference getSocialNetwork_Persons() { | ||
129 | return (EReference) socialNetworkEClass.getEStructuralFeatures().get(1); | ||
130 | } | ||
131 | |||
132 | /** | ||
133 | * <!-- begin-user-doc --> | ||
134 | * <!-- end-user-doc --> | ||
135 | * @generated | ||
136 | */ | ||
137 | @Override | ||
138 | public EClass getPerson() { | ||
139 | return personEClass; | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | */ | ||
147 | @Override | ||
148 | public EReference getPerson_Friends() { | ||
149 | return (EReference) personEClass.getEStructuralFeatures().get(0); | ||
150 | } | ||
151 | |||
152 | /** | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | */ | ||
157 | @Override | ||
158 | public EAttribute getPerson_Name() { | ||
159 | return (EAttribute) personEClass.getEStructuralFeatures().get(1); | ||
160 | } | ||
161 | |||
162 | /** | ||
163 | * <!-- begin-user-doc --> | ||
164 | * <!-- end-user-doc --> | ||
165 | * @generated | ||
166 | */ | ||
167 | @Override | ||
168 | public SocialnetworkFactory getSocialnetworkFactory() { | ||
169 | return (SocialnetworkFactory) getEFactoryInstance(); | ||
170 | } | ||
171 | |||
172 | /** | ||
173 | * <!-- begin-user-doc --> | ||
174 | * <!-- end-user-doc --> | ||
175 | * @generated | ||
176 | */ | ||
177 | private boolean isCreated = false; | ||
178 | |||
179 | /** | ||
180 | * Creates the meta-model objects for the package. This method is | ||
181 | * guarded to have no affect on any invocation but its first. | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | public void createPackageContents() { | ||
187 | if (isCreated) | ||
188 | return; | ||
189 | isCreated = true; | ||
190 | |||
191 | // Create classes and their features | ||
192 | socialNetworkEClass = createEClass(SOCIAL_NETWORK); | ||
193 | createEAttribute(socialNetworkEClass, SOCIAL_NETWORK__NAME); | ||
194 | createEReference(socialNetworkEClass, SOCIAL_NETWORK__PERSONS); | ||
195 | |||
196 | personEClass = createEClass(PERSON); | ||
197 | createEReference(personEClass, PERSON__FRIENDS); | ||
198 | createEAttribute(personEClass, PERSON__NAME); | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * <!-- begin-user-doc --> | ||
203 | * <!-- end-user-doc --> | ||
204 | * @generated | ||
205 | */ | ||
206 | private boolean isInitialized = false; | ||
207 | |||
208 | /** | ||
209 | * Complete the initialization of the package and its meta-model. This | ||
210 | * method is guarded to have no affect on any invocation but its first. | ||
211 | * <!-- begin-user-doc --> | ||
212 | * <!-- end-user-doc --> | ||
213 | * @generated | ||
214 | */ | ||
215 | public void initializePackageContents() { | ||
216 | if (isInitialized) | ||
217 | return; | ||
218 | isInitialized = true; | ||
219 | |||
220 | // Initialize package | ||
221 | setName(eNAME); | ||
222 | setNsPrefix(eNS_PREFIX); | ||
223 | setNsURI(eNS_URI); | ||
224 | |||
225 | // Create type parameters | ||
226 | |||
227 | // Set bounds for type parameters | ||
228 | |||
229 | // Add supertypes to classes | ||
230 | |||
231 | // Initialize classes, features, and operations; add parameters | ||
232 | initEClass(socialNetworkEClass, SocialNetwork.class, "SocialNetwork", !IS_ABSTRACT, !IS_INTERFACE, | ||
233 | IS_GENERATED_INSTANCE_CLASS); | ||
234 | initEAttribute(getSocialNetwork_Name(), ecorePackage.getEString(), "name", "SocialNetwork", 0, 1, | ||
235 | SocialNetwork.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, | ||
236 | !IS_DERIVED, IS_ORDERED); | ||
237 | initEReference(getSocialNetwork_Persons(), this.getPerson(), null, "persons", null, 0, -1, SocialNetwork.class, | ||
238 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
239 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
240 | |||
241 | initEClass(personEClass, Person.class, "Person", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
242 | initEReference(getPerson_Friends(), this.getPerson(), null, "friends", null, 0, -1, Person.class, !IS_TRANSIENT, | ||
243 | !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
244 | IS_ORDERED); | ||
245 | initEAttribute(getPerson_Name(), ecorePackage.getEString(), "name", "Name", 0, 1, Person.class, !IS_TRANSIENT, | ||
246 | !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
247 | |||
248 | // Create resource | ||
249 | createResource(eNS_URI); | ||
250 | |||
251 | // Create annotations | ||
252 | // http://www.eclipse.org/emf/2002/Ecore | ||
253 | createEcoreAnnotations(); | ||
254 | } | ||
255 | |||
256 | /** | ||
257 | * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. | ||
258 | * <!-- begin-user-doc --> | ||
259 | * <!-- end-user-doc --> | ||
260 | * @generated | ||
261 | */ | ||
262 | protected void createEcoreAnnotations() { | ||
263 | String source = "http://www.eclipse.org/emf/2002/Ecore"; | ||
264 | addAnnotation(this, source, new String[] {}); | ||
265 | } | ||
266 | |||
267 | } //SocialnetworkPackageImpl | ||