Skip to content

Package: VRuleRepositoryImpl

VRuleRepositoryImpl

nameinstructionbranchcomplexitylinemethod
VRuleRepositoryImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 10 C: 7
41%
M: 4 C: 2
33%
M: 3 C: 1
25%
M: 1 C: 2
67%
M: 0 C: 1
100%
eSet(int, Object)
M: 17 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getRuleEntries()
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.rulerepository.model.impl;
15:
16: import java.util.Collection;
17:
18: import org.eclipse.emf.common.notify.NotificationChain;
19: import org.eclipse.emf.common.util.EList;
20: import org.eclipse.emf.ecore.EClass;
21: import org.eclipse.emf.ecore.InternalEObject;
22: import org.eclipse.emf.ecore.impl.EObjectImpl;
23: import org.eclipse.emf.ecore.util.EObjectContainmentEList;
24: import org.eclipse.emf.ecore.util.InternalEList;
25: import org.eclipse.emfforms.spi.rulerepository.model.VRuleEntry;
26: import org.eclipse.emfforms.spi.rulerepository.model.VRuleRepository;
27: import org.eclipse.emfforms.spi.rulerepository.model.VRulerepositoryPackage;
28:
29: /**
30: * <!-- begin-user-doc --> An implementation of the model object '
31: * <em><b>Rule Repository</b></em>'. <!-- end-user-doc -->
32: * <p>
33: * The following features are implemented:
34: * </p>
35: * <ul>
36: * <li>{@link org.eclipse.emfforms.spi.rulerepository.model.impl.VRuleRepositoryImpl#getRuleEntries <em>Rule
37: * Entries</em>}</li>
38: * </ul>
39: *
40: * @generated
41: */
42: public class VRuleRepositoryImpl extends EObjectImpl implements VRuleRepository {
43:         /**
44:          * The cached value of the '{@link #getRuleEntries() <em>Rule Entries</em>}' containment reference list.
45:          * <!-- begin-user-doc --> <!-- end-user-doc -->
46:          *
47:          * @see #getRuleEntries()
48:          * @generated
49:          * @ordered
50:          */
51:         protected EList<VRuleEntry> ruleEntries;
52:
53:         /**
54:          * <!-- begin-user-doc --> <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         protected VRuleRepositoryImpl() {
59:                 super();
60:         }
61:
62:         /**
63:          * <!-- begin-user-doc --> <!-- end-user-doc -->
64:          *
65:          * @generated
66:          */
67:         @Override
68:         protected EClass eStaticClass() {
69:                 return VRulerepositoryPackage.Literals.RULE_REPOSITORY;
70:         }
71:
72:         /**
73:          * <!-- begin-user-doc --> <!-- end-user-doc -->
74:          *
75:          * @generated
76:          */
77:         @Override
78:         public EList<VRuleEntry> getRuleEntries() {
79:•                if (ruleEntries == null) {
80:                         ruleEntries = new EObjectContainmentEList<VRuleEntry>(VRuleEntry.class, this,
81:                                 VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES);
82:                 }
83:                 return ruleEntries;
84:         }
85:
86:         /**
87:          * <!-- begin-user-doc --> <!-- end-user-doc -->
88:          *
89:          * @generated
90:          */
91:         @Override
92:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
93:•                switch (featureID) {
94:                 case VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES:
95:                         return ((InternalEList<?>) getRuleEntries()).basicRemove(otherEnd, msgs);
96:                 }
97:                 return super.eInverseRemove(otherEnd, featureID, msgs);
98:         }
99:
100:         /**
101:          * <!-- begin-user-doc --> <!-- end-user-doc -->
102:          *
103:          * @generated
104:          */
105:         @Override
106:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
107:•                switch (featureID) {
108:                 case VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES:
109:                         return getRuleEntries();
110:                 }
111:                 return super.eGet(featureID, resolve, coreType);
112:         }
113:
114:         /**
115:          * <!-- begin-user-doc --> <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @SuppressWarnings("unchecked")
120:         @Override
121:         public void eSet(int featureID, Object newValue) {
122:•                switch (featureID) {
123:                 case VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES:
124:                         getRuleEntries().clear();
125:                         getRuleEntries().addAll((Collection<? extends VRuleEntry>) newValue);
126:                         return;
127:                 }
128:                 super.eSet(featureID, newValue);
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc --> <!-- end-user-doc -->
133:          *
134:          * @generated
135:          */
136:         @Override
137:         public void eUnset(int featureID) {
138:•                switch (featureID) {
139:                 case VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES:
140:                         getRuleEntries().clear();
141:                         return;
142:                 }
143:                 super.eUnset(featureID);
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc --> <!-- end-user-doc -->
148:          *
149:          * @generated
150:          */
151:         @Override
152:         public boolean eIsSet(int featureID) {
153:•                switch (featureID) {
154:                 case VRulerepositoryPackage.RULE_REPOSITORY__RULE_ENTRIES:
155:•                        return ruleEntries != null && !ruleEntries.isEmpty();
156:                 }
157:                 return super.eIsSet(featureID);
158:         }
159:
160: } // VRuleRepositoryImpl