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