Skip to content

Package: EnableRuleImpl

EnableRuleImpl

nameinstructionbranchcomplexitylinemethod
EnableRuleImpl()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 0 C: 12
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
eIsSet(int)
M: 0 C: 9
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
eSet(int, Object)
M: 6 C: 7
54%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 3
60%
M: 0 C: 1
100%
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%
isDisable()
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%
setDisable(boolean)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
toString()
M: 28 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%

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.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecp.view.spi.rule.model.EnableRule;
20: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
21:
22: /**
23: * <!-- begin-user-doc -->
24: * An implementation of the model object '<em><b>Enable Rule</b></em>'.
25: *
26: * @since 1.2
27: * <!-- end-user-doc -->
28: * <p>
29: * The following features are implemented:
30: * </p>
31: * <ul>
32: * <li>{@link org.eclipse.emf.ecp.view.spi.rule.model.impl.EnableRuleImpl#isDisable <em>Disable</em>}</li>
33: * </ul>
34: *
35: * @generated
36: */
37: public class EnableRuleImpl extends RuleImpl implements EnableRule {
38:         /**
39:          * The default value of the '{@link #isDisable() <em>Disable</em>}' attribute.
40:          * <!-- begin-user-doc -->
41:          * <!-- end-user-doc -->
42:          *
43:          * @see #isDisable()
44:          * @generated
45:          * @ordered
46:          */
47:         protected static final boolean DISABLE_EDEFAULT = false;
48:
49:         /**
50:          * The cached value of the '{@link #isDisable() <em>Disable</em>}' attribute.
51:          * <!-- begin-user-doc -->
52:          * <!-- end-user-doc -->
53:          *
54:          * @see #isDisable()
55:          * @generated
56:          * @ordered
57:          */
58:         protected boolean disable = DISABLE_EDEFAULT;
59:
60:         /**
61:          * <!-- begin-user-doc -->
62:          * <!-- end-user-doc -->
63:          *
64:          * @generated
65:          */
66:         protected EnableRuleImpl() {
67:                 super();
68:         }
69:
70:         /**
71:          * <!-- begin-user-doc -->
72:          * <!-- end-user-doc -->
73:          *
74:          * @generated
75:          */
76:         @Override
77:         protected EClass eStaticClass() {
78:                 return RulePackage.Literals.ENABLE_RULE;
79:         }
80:
81:         /**
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         @Override
88:         public boolean isDisable() {
89:                 return disable;
90:         }
91:
92:         /**
93:          * <!-- begin-user-doc -->
94:          * <!-- end-user-doc -->
95:          *
96:          * @generated
97:          */
98:         @Override
99:         public void setDisable(boolean newDisable) {
100:                 final boolean oldDisable = disable;
101:                 disable = newDisable;
102:•                if (eNotificationRequired()) {
103:                         eNotify(
104:                                 new ENotificationImpl(this, Notification.SET, RulePackage.ENABLE_RULE__DISABLE, oldDisable, disable));
105:                 }
106:         }
107:
108:         /**
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @generated
113:          */
114:         @Override
115:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
116:•                switch (featureID) {
117:                 case RulePackage.ENABLE_RULE__DISABLE:
118:                         return isDisable();
119:                 }
120:                 return super.eGet(featureID, resolve, coreType);
121:         }
122:
123:         /**
124:          * <!-- begin-user-doc -->
125:          * <!-- end-user-doc -->
126:          *
127:          * @generated
128:          */
129:         @Override
130:         public void eSet(int featureID, Object newValue) {
131:•                switch (featureID) {
132:                 case RulePackage.ENABLE_RULE__DISABLE:
133:                         setDisable((Boolean) newValue);
134:                         return;
135:                 }
136:                 super.eSet(featureID, newValue);
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc -->
141:          * <!-- end-user-doc -->
142:          *
143:          * @generated
144:          */
145:         @Override
146:         public void eUnset(int featureID) {
147:•                switch (featureID) {
148:                 case RulePackage.ENABLE_RULE__DISABLE:
149:                         setDisable(DISABLE_EDEFAULT);
150:                         return;
151:                 }
152:                 super.eUnset(featureID);
153:         }
154:
155:         /**
156:          * <!-- begin-user-doc -->
157:          * <!-- end-user-doc -->
158:          *
159:          * @generated
160:          */
161:         @Override
162:         public boolean eIsSet(int featureID) {
163:•                switch (featureID) {
164:                 case RulePackage.ENABLE_RULE__DISABLE:
165:                         return disable != DISABLE_EDEFAULT;
166:                 }
167:                 return super.eIsSet(featureID);
168:         }
169:
170:         /**
171:          * <!-- begin-user-doc -->
172:          * <!-- end-user-doc -->
173:          *
174:          * @generated
175:          */
176:         @Override
177:         public String toString() {
178:•                if (eIsProxy()) {
179:                         return super.toString();
180:                 }
181:
182:                 final StringBuffer result = new StringBuffer(super.toString());
183:                 result.append(" (disable: "); //$NON-NLS-1$
184:                 result.append(disable);
185:                 result.append(')');
186:                 return result.toString();
187:         }
188:
189: } // EnableRuleImpl