1 | /** |
2 | * Copyright 2008, sdq.ipd.uka.de, U KA |
3 | * |
4 | * $Id$ |
5 | */ |
6 | package de.uka.ipd.sdq.simucomframework.simucomstatus.impl; |
7 | |
8 | import de.uka.ipd.sdq.simucomframework.simucomstatus.SimucomstatusPackage; |
9 | import de.uka.ipd.sdq.simucomframework.simucomstatus.SimulatedProcesses; |
10 | |
11 | import java.util.Collection; |
12 | |
13 | import org.eclipse.emf.common.notify.NotificationChain; |
14 | |
15 | import org.eclipse.emf.common.util.EList; |
16 | |
17 | import org.eclipse.emf.ecore.EClass; |
18 | import org.eclipse.emf.ecore.InternalEObject; |
19 | |
20 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
21 | |
22 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
23 | import org.eclipse.emf.ecore.util.InternalEList; |
24 | |
25 | /** |
26 | * <!-- begin-user-doc --> |
27 | * An implementation of the model object '<em><b>Simulated Processes</b></em>'. |
28 | * <!-- end-user-doc --> |
29 | * <p> |
30 | * The following features are implemented: |
31 | * <ul> |
32 | * <li>{@link de.uka.ipd.sdq.simucomframework.simucomstatus.impl.SimulatedProcessesImpl#getProcesses <em>Processes</em>}</li> |
33 | * </ul> |
34 | * </p> |
35 | * |
36 | * @generated |
37 | */ |
38 | public class SimulatedProcessesImpl extends EObjectImpl implements SimulatedProcesses { |
39 | /** |
40 | * The cached value of the '{@link #getProcesses() <em>Processes</em>}' containment reference list. |
41 | * <!-- begin-user-doc --> |
42 | * <!-- end-user-doc --> |
43 | * @see #getProcesses() |
44 | * @generated |
45 | * @ordered |
46 | */ |
47 | protected EList<de.uka.ipd.sdq.simucomframework.simucomstatus.Process> processes; |
48 | |
49 | /** |
50 | * <!-- begin-user-doc --> |
51 | * <!-- end-user-doc --> |
52 | * @generated |
53 | */ |
54 | protected SimulatedProcessesImpl() { |
55 | super(); |
56 | } |
57 | |
58 | /** |
59 | * <!-- begin-user-doc --> |
60 | * <!-- end-user-doc --> |
61 | * @generated |
62 | */ |
63 | @Override |
64 | protected EClass eStaticClass() { |
65 | return SimucomstatusPackage.Literals.SIMULATED_PROCESSES; |
66 | } |
67 | |
68 | /** |
69 | * <!-- begin-user-doc --> |
70 | * <!-- end-user-doc --> |
71 | * @generated |
72 | */ |
73 | public EList<de.uka.ipd.sdq.simucomframework.simucomstatus.Process> getProcesses() { |
74 | if (processes == null) { |
75 | processes = new EObjectContainmentEList<de.uka.ipd.sdq.simucomframework.simucomstatus.Process>(de.uka.ipd.sdq.simucomframework.simucomstatus.Process.class, this, SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES); |
76 | } |
77 | return processes; |
78 | } |
79 | |
80 | /** |
81 | * <!-- begin-user-doc --> |
82 | * <!-- end-user-doc --> |
83 | * @generated |
84 | */ |
85 | @Override |
86 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
87 | switch (featureID) { |
88 | case SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES: |
89 | return ((InternalEList<?>)getProcesses()).basicRemove(otherEnd, msgs); |
90 | } |
91 | return super.eInverseRemove(otherEnd, featureID, msgs); |
92 | } |
93 | |
94 | /** |
95 | * <!-- begin-user-doc --> |
96 | * <!-- end-user-doc --> |
97 | * @generated |
98 | */ |
99 | @Override |
100 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
101 | switch (featureID) { |
102 | case SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES: |
103 | return getProcesses(); |
104 | } |
105 | return super.eGet(featureID, resolve, coreType); |
106 | } |
107 | |
108 | /** |
109 | * <!-- begin-user-doc --> |
110 | * <!-- end-user-doc --> |
111 | * @generated |
112 | */ |
113 | @SuppressWarnings("unchecked") |
114 | @Override |
115 | public void eSet(int featureID, Object newValue) { |
116 | switch (featureID) { |
117 | case SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES: |
118 | getProcesses().clear(); |
119 | getProcesses().addAll((Collection<? extends de.uka.ipd.sdq.simucomframework.simucomstatus.Process>)newValue); |
120 | return; |
121 | } |
122 | super.eSet(featureID, newValue); |
123 | } |
124 | |
125 | /** |
126 | * <!-- begin-user-doc --> |
127 | * <!-- end-user-doc --> |
128 | * @generated |
129 | */ |
130 | @Override |
131 | public void eUnset(int featureID) { |
132 | switch (featureID) { |
133 | case SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES: |
134 | getProcesses().clear(); |
135 | return; |
136 | } |
137 | super.eUnset(featureID); |
138 | } |
139 | |
140 | /** |
141 | * <!-- begin-user-doc --> |
142 | * <!-- end-user-doc --> |
143 | * @generated |
144 | */ |
145 | @Override |
146 | public boolean eIsSet(int featureID) { |
147 | switch (featureID) { |
148 | case SimucomstatusPackage.SIMULATED_PROCESSES__PROCESSES: |
149 | return processes != null && !processes.isEmpty(); |
150 | } |
151 | return super.eIsSet(featureID); |
152 | } |
153 | |
154 | } //SimulatedProcessesImpl |