aboutsummaryrefslogtreecommitdiffstats
path: root/Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java
diff options
context:
space:
mode:
Diffstat (limited to 'Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java')
-rw-r--r--Metrics/Metrics-Calculation/SocialNetwork_plugin/encore_gen/socialnetwork/impl/PersonImpl.java208
1 files changed, 208 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 */
3package socialnetwork.impl;
4
5import java.util.Collection;
6
7import org.eclipse.emf.common.notify.Notification;
8
9import org.eclipse.emf.common.util.EList;
10
11import org.eclipse.emf.ecore.EClass;
12
13import org.eclipse.emf.ecore.impl.ENotificationImpl;
14import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
15
16import org.eclipse.emf.ecore.util.EObjectResolvingEList;
17
18import socialnetwork.Person;
19import 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 */
35public 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