Skip to content

Package: RuleImpl

RuleImpl

nameinstructionbranchcomplexitylinemethod
RuleImpl()
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%
basicSetCondition(Condition, NotificationChain)
M: 4 C: 25
86%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 1 C: 10
91%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 6 C: 5
45%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 13 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: 4 C: 9
69%
M: 1 C: 3
75%
M: 1 C: 2
67%
M: 1 C: 2
67%
M: 0 C: 1
100%
eSet(int, Object)
M: 5 C: 7
58%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 3
60%
M: 0 C: 1
100%
eStaticClass()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
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%
getCondition()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setCondition(Condition)
M: 13 C: 39
75%
M: 3 C: 7
70%
M: 2 C: 4
67%
M: 2 C: 13
87%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * EclipseSource Munich GmbH - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.spi.rule.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.common.notify.NotificationChain;
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecore.InternalEObject;
20: import org.eclipse.emf.ecore.impl.ENotificationImpl;
21: import org.eclipse.emf.ecp.view.spi.model.impl.VAttachmentImpl;
22: import org.eclipse.emf.ecp.view.spi.rule.model.Condition;
23: import org.eclipse.emf.ecp.view.spi.rule.model.Rule;
24: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model object '<em><b>Rule</b></em>'.
29: *
30: * @since 1.2
31: * <!-- end-user-doc -->
32: * <p>
33: * The following features are implemented:
34: * </p>
35: * <ul>
36: * <li>{@link org.eclipse.emf.ecp.view.spi.rule.model.impl.RuleImpl#getCondition <em>Condition</em>}</li>
37: * </ul>
38: *
39: * @generated
40: */
41: public abstract class RuleImpl extends VAttachmentImpl implements Rule {
42:         /**
43:          * The cached value of the '{@link #getCondition() <em>Condition</em>}' containment reference.
44:          * <!-- begin-user-doc -->
45:          * <!-- end-user-doc -->
46:          *
47:          * @see #getCondition()
48:          * @generated
49:          * @ordered
50:          */
51:         protected Condition condition;
52:
53:         /**
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @generated
58:          */
59:         protected RuleImpl() {
60:                 super();
61:         }
62:
63:         /**
64:          * <!-- begin-user-doc -->
65:          * <!-- end-user-doc -->
66:          *
67:          * @generated
68:          */
69:         @Override
70:         protected EClass eStaticClass() {
71:                 return RulePackage.Literals.RULE;
72:         }
73:
74:         /**
75:          * <!-- begin-user-doc -->
76:          * <!-- end-user-doc -->
77:          *
78:          * @generated
79:          */
80:         @Override
81:         public Condition getCondition() {
82:                 return condition;
83:         }
84:
85:         /**
86:          * <!-- begin-user-doc -->
87:          * <!-- end-user-doc -->
88:          *
89:          * @generated
90:          */
91:         public NotificationChain basicSetCondition(Condition newCondition,
92:                 NotificationChain msgs) {
93:                 final Condition oldCondition = condition;
94:                 condition = newCondition;
95:•                if (eNotificationRequired()) {
96:                         final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
97:                                 RulePackage.RULE__CONDITION,
98:                                 oldCondition, newCondition);
99:•                        if (msgs == null) {
100:                                 msgs = notification;
101:                         } else {
102:                                 msgs.add(notification);
103:                         }
104:                 }
105:                 return msgs;
106:         }
107:
108:         /**
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         @Override
115:         public void setCondition(Condition newCondition) {
116:•                if (newCondition != condition) {
117:                         NotificationChain msgs = null;
118:•                        if (condition != null) {
119:                                 msgs = ((InternalEObject) condition).eInverseRemove(this,
120:                                         EOPPOSITE_FEATURE_BASE - RulePackage.RULE__CONDITION, null, msgs);
121:                         }
122:•                        if (newCondition != null) {
123:                                 msgs = ((InternalEObject) newCondition).eInverseAdd(this,
124:                                         EOPPOSITE_FEATURE_BASE - RulePackage.RULE__CONDITION, null, msgs);
125:                         }
126:                         msgs = basicSetCondition(newCondition, msgs);
127:•                        if (msgs != null) {
128:                                 msgs.dispatch();
129:                         }
130:•                } else if (eNotificationRequired()) {
131:                         eNotify(
132:                                 new ENotificationImpl(this, Notification.SET, RulePackage.RULE__CONDITION, newCondition, newCondition));
133:                 }
134:         }
135:
136:         /**
137:          * <!-- begin-user-doc -->
138:          * <!-- end-user-doc -->
139:          *
140:          * @generated
141:          */
142:         @Override
143:         public NotificationChain eInverseRemove(InternalEObject otherEnd,
144:                 int featureID, NotificationChain msgs) {
145:•                switch (featureID) {
146:                 case RulePackage.RULE__CONDITION:
147:                         return basicSetCondition(null, msgs);
148:                 }
149:                 return super.eInverseRemove(otherEnd, featureID, msgs);
150:         }
151:
152:         /**
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @generated
157:          */
158:         @Override
159:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
160:•                switch (featureID) {
161:                 case RulePackage.RULE__CONDITION:
162:                         return getCondition();
163:                 }
164:                 return super.eGet(featureID, resolve, coreType);
165:         }
166:
167:         /**
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         @Override
174:         public void eSet(int featureID, Object newValue) {
175:•                switch (featureID) {
176:                 case RulePackage.RULE__CONDITION:
177:                         setCondition((Condition) newValue);
178:                         return;
179:                 }
180:                 super.eSet(featureID, newValue);
181:         }
182:
183:         /**
184:          * <!-- begin-user-doc -->
185:          * <!-- end-user-doc -->
186:          *
187:          * @generated
188:          */
189:         @Override
190:         public void eUnset(int featureID) {
191:•                switch (featureID) {
192:                 case RulePackage.RULE__CONDITION:
193:                         setCondition((Condition) null);
194:                         return;
195:                 }
196:                 super.eUnset(featureID);
197:         }
198:
199:         /**
200:          * <!-- begin-user-doc -->
201:          * <!-- end-user-doc -->
202:          *
203:          * @generated
204:          */
205:         @Override
206:         public boolean eIsSet(int featureID) {
207:•                switch (featureID) {
208:                 case RulePackage.RULE__CONDITION:
209:•                        return condition != null;
210:                 }
211:                 return super.eIsSet(featureID);
212:         }
213:
214: } // RuleImpl