| 1 | /** |
| 2 | * <copyright> |
| 3 | * </copyright> |
| 4 | * |
| 5 | * $Id$ |
| 6 | */ |
| 7 | package scheduler.impl; |
| 8 | |
| 9 | import java.util.Collection; |
| 10 | |
| 11 | import org.eclipse.emf.common.notify.NotificationChain; |
| 12 | |
| 13 | import org.eclipse.emf.common.util.EList; |
| 14 | |
| 15 | import org.eclipse.emf.ecore.EClass; |
| 16 | import org.eclipse.emf.ecore.InternalEObject; |
| 17 | |
| 18 | import org.eclipse.emf.ecore.impl.EObjectImpl; |
| 19 | |
| 20 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| 21 | import org.eclipse.emf.ecore.util.InternalEList; |
| 22 | |
| 23 | import scheduler.SchedulerPackage; |
| 24 | import scheduler.SystemConfiguration; |
| 25 | |
| 26 | import scheduler.configuration.ActiveResourceConfiguration; |
| 27 | import scheduler.configuration.PassiveResourceConfiguration; |
| 28 | import scheduler.configuration.ProcessConfiguration; |
| 29 | |
| 30 | /** |
| 31 | * <!-- begin-user-doc --> |
| 32 | * An implementation of the model object '<em><b>System Configuration</b></em>'. |
| 33 | * <!-- end-user-doc --> |
| 34 | * <p> |
| 35 | * The following features are implemented: |
| 36 | * <ul> |
| 37 | * <li>{@link scheduler.impl.SystemConfigurationImpl#getProcessConfiguration <em>Process Configuration</em>}</li> |
| 38 | * <li>{@link scheduler.impl.SystemConfigurationImpl#getActiveResourceConfiguration <em>Active Resource Configuration</em>}</li> |
| 39 | * <li>{@link scheduler.impl.SystemConfigurationImpl#getPassiveResourceConfiguration <em>Passive Resource Configuration</em>}</li> |
| 40 | * </ul> |
| 41 | * </p> |
| 42 | * |
| 43 | * @generated |
| 44 | */ |
| 45 | public class SystemConfigurationImpl extends EObjectImpl implements SystemConfiguration { |
| 46 | /** |
| 47 | * The cached value of the '{@link #getProcessConfiguration() <em>Process Configuration</em>}' containment reference list. |
| 48 | * <!-- begin-user-doc --> |
| 49 | * <!-- end-user-doc --> |
| 50 | * @see #getProcessConfiguration() |
| 51 | * @generated |
| 52 | * @ordered |
| 53 | */ |
| 54 | protected EList<ProcessConfiguration> processConfiguration; |
| 55 | |
| 56 | /** |
| 57 | * The cached value of the '{@link #getActiveResourceConfiguration() <em>Active Resource Configuration</em>}' containment reference list. |
| 58 | * <!-- begin-user-doc --> |
| 59 | * <!-- end-user-doc --> |
| 60 | * @see #getActiveResourceConfiguration() |
| 61 | * @generated |
| 62 | * @ordered |
| 63 | */ |
| 64 | protected EList<ActiveResourceConfiguration> activeResourceConfiguration; |
| 65 | |
| 66 | /** |
| 67 | * The cached value of the '{@link #getPassiveResourceConfiguration() <em>Passive Resource Configuration</em>}' containment reference list. |
| 68 | * <!-- begin-user-doc --> |
| 69 | * <!-- end-user-doc --> |
| 70 | * @see #getPassiveResourceConfiguration() |
| 71 | * @generated |
| 72 | * @ordered |
| 73 | */ |
| 74 | protected EList<PassiveResourceConfiguration> passiveResourceConfiguration; |
| 75 | |
| 76 | /** |
| 77 | * <!-- begin-user-doc --> |
| 78 | * <!-- end-user-doc --> |
| 79 | * @generated |
| 80 | */ |
| 81 | protected SystemConfigurationImpl() { |
| 82 | super(); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * <!-- begin-user-doc --> |
| 87 | * <!-- end-user-doc --> |
| 88 | * @generated |
| 89 | */ |
| 90 | @Override |
| 91 | protected EClass eStaticClass() { |
| 92 | return SchedulerPackage.Literals.SYSTEM_CONFIGURATION; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * <!-- begin-user-doc --> |
| 97 | * <!-- end-user-doc --> |
| 98 | * @generated |
| 99 | */ |
| 100 | public EList<ProcessConfiguration> getProcessConfiguration() { |
| 101 | if (processConfiguration == null) { |
| 102 | processConfiguration = new EObjectContainmentEList<ProcessConfiguration>(ProcessConfiguration.class, this, SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION); |
| 103 | } |
| 104 | return processConfiguration; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * <!-- begin-user-doc --> |
| 109 | * <!-- end-user-doc --> |
| 110 | * @generated |
| 111 | */ |
| 112 | public EList<ActiveResourceConfiguration> getActiveResourceConfiguration() { |
| 113 | if (activeResourceConfiguration == null) { |
| 114 | activeResourceConfiguration = new EObjectContainmentEList<ActiveResourceConfiguration>(ActiveResourceConfiguration.class, this, SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION); |
| 115 | } |
| 116 | return activeResourceConfiguration; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * <!-- begin-user-doc --> |
| 121 | * <!-- end-user-doc --> |
| 122 | * @generated |
| 123 | */ |
| 124 | public EList<PassiveResourceConfiguration> getPassiveResourceConfiguration() { |
| 125 | if (passiveResourceConfiguration == null) { |
| 126 | passiveResourceConfiguration = new EObjectContainmentEList<PassiveResourceConfiguration>(PassiveResourceConfiguration.class, this, SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION); |
| 127 | } |
| 128 | return passiveResourceConfiguration; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * <!-- begin-user-doc --> |
| 133 | * <!-- end-user-doc --> |
| 134 | * @generated |
| 135 | */ |
| 136 | @Override |
| 137 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| 138 | switch (featureID) { |
| 139 | case SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION: |
| 140 | return ((InternalEList<?>)getProcessConfiguration()).basicRemove(otherEnd, msgs); |
| 141 | case SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION: |
| 142 | return ((InternalEList<?>)getActiveResourceConfiguration()).basicRemove(otherEnd, msgs); |
| 143 | case SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION: |
| 144 | return ((InternalEList<?>)getPassiveResourceConfiguration()).basicRemove(otherEnd, msgs); |
| 145 | } |
| 146 | return super.eInverseRemove(otherEnd, featureID, msgs); |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * <!-- begin-user-doc --> |
| 151 | * <!-- end-user-doc --> |
| 152 | * @generated |
| 153 | */ |
| 154 | @Override |
| 155 | public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| 156 | switch (featureID) { |
| 157 | case SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION: |
| 158 | return getProcessConfiguration(); |
| 159 | case SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION: |
| 160 | return getActiveResourceConfiguration(); |
| 161 | case SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION: |
| 162 | return getPassiveResourceConfiguration(); |
| 163 | } |
| 164 | return super.eGet(featureID, resolve, coreType); |
| 165 | } |
| 166 | |
| 167 | /** |
| 168 | * <!-- begin-user-doc --> |
| 169 | * <!-- end-user-doc --> |
| 170 | * @generated |
| 171 | */ |
| 172 | @SuppressWarnings("unchecked") |
| 173 | @Override |
| 174 | public void eSet(int featureID, Object newValue) { |
| 175 | switch (featureID) { |
| 176 | case SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION: |
| 177 | getProcessConfiguration().clear(); |
| 178 | getProcessConfiguration().addAll((Collection<? extends ProcessConfiguration>)newValue); |
| 179 | return; |
| 180 | case SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION: |
| 181 | getActiveResourceConfiguration().clear(); |
| 182 | getActiveResourceConfiguration().addAll((Collection<? extends ActiveResourceConfiguration>)newValue); |
| 183 | return; |
| 184 | case SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION: |
| 185 | getPassiveResourceConfiguration().clear(); |
| 186 | getPassiveResourceConfiguration().addAll((Collection<? extends PassiveResourceConfiguration>)newValue); |
| 187 | return; |
| 188 | } |
| 189 | super.eSet(featureID, newValue); |
| 190 | } |
| 191 | |
| 192 | /** |
| 193 | * <!-- begin-user-doc --> |
| 194 | * <!-- end-user-doc --> |
| 195 | * @generated |
| 196 | */ |
| 197 | @Override |
| 198 | public void eUnset(int featureID) { |
| 199 | switch (featureID) { |
| 200 | case SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION: |
| 201 | getProcessConfiguration().clear(); |
| 202 | return; |
| 203 | case SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION: |
| 204 | getActiveResourceConfiguration().clear(); |
| 205 | return; |
| 206 | case SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION: |
| 207 | getPassiveResourceConfiguration().clear(); |
| 208 | return; |
| 209 | } |
| 210 | super.eUnset(featureID); |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * <!-- begin-user-doc --> |
| 215 | * <!-- end-user-doc --> |
| 216 | * @generated |
| 217 | */ |
| 218 | @Override |
| 219 | public boolean eIsSet(int featureID) { |
| 220 | switch (featureID) { |
| 221 | case SchedulerPackage.SYSTEM_CONFIGURATION__PROCESS_CONFIGURATION: |
| 222 | return processConfiguration != null && !processConfiguration.isEmpty(); |
| 223 | case SchedulerPackage.SYSTEM_CONFIGURATION__ACTIVE_RESOURCE_CONFIGURATION: |
| 224 | return activeResourceConfiguration != null && !activeResourceConfiguration.isEmpty(); |
| 225 | case SchedulerPackage.SYSTEM_CONFIGURATION__PASSIVE_RESOURCE_CONFIGURATION: |
| 226 | return passiveResourceConfiguration != null && !passiveResourceConfiguration.isEmpty(); |
| 227 | } |
| 228 | return super.eIsSet(featureID); |
| 229 | } |
| 230 | |
| 231 | } //SystemConfigurationImpl |