1 | /** |
2 | * <copyright> |
3 | * </copyright> |
4 | * |
5 | * $Id$ |
6 | */ |
7 | package LqnCore.impl; |
8 | |
9 | import LqnCore.InPortType; |
10 | import LqnCore.InterfaceType; |
11 | import LqnCore.LqnCorePackage; |
12 | import LqnCore.OutPortType; |
13 | |
14 | import java.util.Collection; |
15 | |
16 | import org.eclipse.emf.common.notify.NotificationChain; |
17 | |
18 | import org.eclipse.emf.common.util.EList; |
19 | |
20 | import org.eclipse.emf.ecore.EClass; |
21 | import org.eclipse.emf.ecore.InternalEObject; |
22 | |
23 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
24 | |
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>Interface Type</b></em>'. |
31 | * <!-- end-user-doc --> |
32 | * <p> |
33 | * The following features are implemented: |
34 | * <ul> |
35 | * <li>{@link LqnCore.impl.InterfaceTypeImpl#getInPort <em>In Port</em>}</li> |
36 | * <li>{@link LqnCore.impl.InterfaceTypeImpl#getOutPort <em>Out Port</em>}</li> |
37 | * </ul> |
38 | * </p> |
39 | * |
40 | * @generated |
41 | */ |
42 | public class InterfaceTypeImpl extends EObjectImpl implements InterfaceType { |
43 | /** |
44 | * The cached value of the '{@link #getInPort() <em>In Port</em>}' containment reference list. |
45 | * <!-- begin-user-doc --> |
46 | * <!-- end-user-doc --> |
47 | * @see #getInPort() |
48 | * @generated |
49 | * @ordered |
50 | */ |
51 | protected EList<InPortType> inPort; |
52 | |
53 | /** |
54 | * The cached value of the '{@link #getOutPort() <em>Out Port</em>}' containment reference list. |
55 | * <!-- begin-user-doc --> |
56 | * <!-- end-user-doc --> |
57 | * @see #getOutPort() |
58 | * @generated |
59 | * @ordered |
60 | */ |
61 | protected EList<OutPortType> outPort; |
62 | |
63 | /** |
64 | * <!-- begin-user-doc --> |
65 | * <!-- end-user-doc --> |
66 | * @generated |
67 | */ |
68 | protected InterfaceTypeImpl() { |
69 | super(); |
70 | } |
71 | |
72 | /** |
73 | * <!-- begin-user-doc --> |
74 | * <!-- end-user-doc --> |
75 | * @generated |
76 | */ |
77 | @Override |
78 | protected EClass eStaticClass() { |
79 | return LqnCorePackage.Literals.INTERFACE_TYPE; |
80 | } |
81 | |
82 | /** |
83 | * <!-- begin-user-doc --> |
84 | * <!-- end-user-doc --> |
85 | * @generated |
86 | */ |
87 | public EList<InPortType> getInPort() { |
88 | if (inPort == null) { |
89 | inPort = new EObjectContainmentEList<InPortType>(InPortType.class, this, LqnCorePackage.INTERFACE_TYPE__IN_PORT); |
90 | } |
91 | return inPort; |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | public EList<OutPortType> getOutPort() { |
100 | if (outPort == null) { |
101 | outPort = new EObjectContainmentEList<OutPortType>(OutPortType.class, this, LqnCorePackage.INTERFACE_TYPE__OUT_PORT); |
102 | } |
103 | return outPort; |
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 LqnCorePackage.INTERFACE_TYPE__IN_PORT: |
115 | return ((InternalEList<?>)getInPort()).basicRemove(otherEnd, msgs); |
116 | case LqnCorePackage.INTERFACE_TYPE__OUT_PORT: |
117 | return ((InternalEList<?>)getOutPort()).basicRemove(otherEnd, msgs); |
118 | } |
119 | return super.eInverseRemove(otherEnd, featureID, msgs); |
120 | } |
121 | |
122 | /** |
123 | * <!-- begin-user-doc --> |
124 | * <!-- end-user-doc --> |
125 | * @generated |
126 | */ |
127 | @Override |
128 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
129 | switch (featureID) { |
130 | case LqnCorePackage.INTERFACE_TYPE__IN_PORT: |
131 | return getInPort(); |
132 | case LqnCorePackage.INTERFACE_TYPE__OUT_PORT: |
133 | return getOutPort(); |
134 | } |
135 | return super.eGet(featureID, resolve, coreType); |
136 | } |
137 | |
138 | /** |
139 | * <!-- begin-user-doc --> |
140 | * <!-- end-user-doc --> |
141 | * @generated |
142 | */ |
143 | @SuppressWarnings("unchecked") |
144 | @Override |
145 | public void eSet(int featureID, Object newValue) { |
146 | switch (featureID) { |
147 | case LqnCorePackage.INTERFACE_TYPE__IN_PORT: |
148 | getInPort().clear(); |
149 | getInPort().addAll((Collection<? extends InPortType>)newValue); |
150 | return; |
151 | case LqnCorePackage.INTERFACE_TYPE__OUT_PORT: |
152 | getOutPort().clear(); |
153 | getOutPort().addAll((Collection<? extends OutPortType>)newValue); |
154 | return; |
155 | } |
156 | super.eSet(featureID, newValue); |
157 | } |
158 | |
159 | /** |
160 | * <!-- begin-user-doc --> |
161 | * <!-- end-user-doc --> |
162 | * @generated |
163 | */ |
164 | @Override |
165 | public void eUnset(int featureID) { |
166 | switch (featureID) { |
167 | case LqnCorePackage.INTERFACE_TYPE__IN_PORT: |
168 | getInPort().clear(); |
169 | return; |
170 | case LqnCorePackage.INTERFACE_TYPE__OUT_PORT: |
171 | getOutPort().clear(); |
172 | return; |
173 | } |
174 | super.eUnset(featureID); |
175 | } |
176 | |
177 | /** |
178 | * <!-- begin-user-doc --> |
179 | * <!-- end-user-doc --> |
180 | * @generated |
181 | */ |
182 | @Override |
183 | public boolean eIsSet(int featureID) { |
184 | switch (featureID) { |
185 | case LqnCorePackage.INTERFACE_TYPE__IN_PORT: |
186 | return inPort != null && !inPort.isEmpty(); |
187 | case LqnCorePackage.INTERFACE_TYPE__OUT_PORT: |
188 | return outPort != null && !outPort.isEmpty(); |
189 | } |
190 | return super.eIsSet(featureID); |
191 | } |
192 | |
193 | } //InterfaceTypeImpl |