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