aboutsummaryrefslogtreecommitdiffstats
path: root/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java')
-rw-r--r--Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/SocialNetworkImpl.java228
1 files changed, 228 insertions, 0 deletions
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 */
3package socialnetwork.impl;
4
5import java.util.Collection;
6
7import org.eclipse.emf.common.notify.Notification;
8import org.eclipse.emf.common.notify.NotificationChain;
9
10import org.eclipse.emf.common.util.EList;
11
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.emf.ecore.InternalEObject;
14
15import org.eclipse.emf.ecore.impl.ENotificationImpl;
16import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
17
18import org.eclipse.emf.ecore.util.EObjectContainmentEList;
19import org.eclipse.emf.ecore.util.InternalEList;
20
21import socialnetwork.Person;
22import socialnetwork.SocialNetwork;
23import 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 */
39public 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