1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package com.hammurapi.eventbus.snapshot.impl; |
8 | |
9 | import com.hammurapi.eventbus.snapshot.JoinEntry; |
10 | import com.hammurapi.eventbus.snapshot.JoinInputCollector; |
11 | import com.hammurapi.eventbus.snapshot.SnapshotPackage; |
12 | |
13 | import java.util.Collection; |
14 | |
15 | import org.eclipse.emf.common.notify.NotificationChain; |
16 | |
17 | import org.eclipse.emf.common.util.EList; |
18 | |
19 | import org.eclipse.emf.ecore.EClass; |
20 | import org.eclipse.emf.ecore.InternalEObject; |
21 | |
22 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
23 | |
24 | import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
25 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
26 | import org.eclipse.emf.ecore.util.InternalEList; |
27 | |
28 | /** |
29 | * <!-- begin-user-doc --> |
30 | * An implementation of the model object '<em><b>Join Input Collector</b></em>'. |
31 | * <!-- end-user-doc --> |
32 | * <p> |
33 | * The following features are implemented: |
34 | * <ul> |
35 | * <li>{@link com.hammurapi.eventbus.snapshot.impl.JoinInputCollectorImpl#getIndices <em>Indices</em>}</li> |
36 | * <li>{@link com.hammurapi.eventbus.snapshot.impl.JoinInputCollectorImpl#getJoinEntries <em>Join Entries</em>}</li> |
37 | * </ul> |
38 | * </p> |
39 | * |
40 | * @generated |
41 | */ |
42 | public class JoinInputCollectorImpl extends EObjectImpl implements JoinInputCollector { |
43 | /** |
44 | * The cached value of the '{@link #getIndices() <em>Indices</em>}' attribute list. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @see #getIndices() |
48 | * @generated |
49 | * @ordered |
50 | */ |
51 | protected EList<Integer> indices; |
52 | |
53 | /** |
54 | * The cached value of the '{@link #getJoinEntries() <em>Join Entries</em>}' containment reference list. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @see #getJoinEntries() |
58 | * @generated |
59 | * @ordered |
60 | */ |
61 | protected EList<JoinEntry> joinEntries; |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | protected JoinInputCollectorImpl() { |
69 | super(); |
70 | } |
71 | |
72 | /** |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | @Override |
78 | protected EClass eStaticClass() { |
79 | return SnapshotPackage.Literals.JOIN_INPUT_COLLECTOR; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | public EList<Integer> getIndices() { |
88 | if (indices == null) { |
89 | indices = new EDataTypeUniqueEList<Integer>(Integer.class, this, SnapshotPackage.JOIN_INPUT_COLLECTOR__INDICES); |
90 | } |
91 | return indices; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public EList<JoinEntry> getJoinEntries() { |
100 | if (joinEntries == null) { |
101 | joinEntries = new EObjectContainmentEList<JoinEntry>(JoinEntry.class, this, SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES); |
102 | } |
103 | return joinEntries; |
104 | } |
105 | |
106 | /** |
107 | * <!-- begin-user-doc --> |
108 | * <!-- end-user-doc --> |
109 | * @generated |
110 | */ |
111 | @Override |
112 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
113 | switch (featureID) { |
114 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES: |
115 | return ((InternalEList<?>)getJoinEntries()).basicRemove(otherEnd, msgs); |
116 | } |
117 | return super.eInverseRemove(otherEnd, featureID, msgs); |
118 | } |
119 | |
120 | /** |
121 | * <!-- begin-user-doc --> |
122 | * <!-- end-user-doc --> |
123 | * @generated |
124 | */ |
125 | @Override |
126 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
127 | switch (featureID) { |
128 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__INDICES: |
129 | return getIndices(); |
130 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES: |
131 | return getJoinEntries(); |
132 | } |
133 | return super.eGet(featureID, resolve, coreType); |
134 | } |
135 | |
136 | /** |
137 | * <!-- begin-user-doc --> |
138 | * <!-- end-user-doc --> |
139 | * @generated |
140 | */ |
141 | @SuppressWarnings("unchecked") |
142 | @Override |
143 | public void eSet(int featureID, Object newValue) { |
144 | switch (featureID) { |
145 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__INDICES: |
146 | getIndices().clear(); |
147 | getIndices().addAll((Collection<? extends Integer>)newValue); |
148 | return; |
149 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES: |
150 | getJoinEntries().clear(); |
151 | getJoinEntries().addAll((Collection<? extends JoinEntry>)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 SnapshotPackage.JOIN_INPUT_COLLECTOR__INDICES: |
166 | getIndices().clear(); |
167 | return; |
168 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES: |
169 | getJoinEntries().clear(); |
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 SnapshotPackage.JOIN_INPUT_COLLECTOR__INDICES: |
184 | return indices != null && !indices.isEmpty(); |
185 | case SnapshotPackage.JOIN_INPUT_COLLECTOR__JOIN_ENTRIES: |
186 | return joinEntries != null && !joinEntries.isEmpty(); |
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()) return super.toString(); |
199 | |
200 | StringBuffer result = new StringBuffer(super.toString()); |
201 | result.append(" (indices: "); |
202 | result.append(indices); |
203 | result.append(')'); |
204 | return result.toString(); |
205 | } |
206 | |
207 | } //JoinInputCollectorImpl |