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