Skip to content

Package: NotConditionService

NotConditionService

nameinstructionbranchcomplexitylinemethod
NotConditionService()
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%
components(NotCondition)
M: 2 C: 8
80%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 3
75%
M: 0 C: 1
100%
getConditionType()
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%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017 Christian W. Damus 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: * Christian W. Damus - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.internal.rule;
15:
16: import java.util.Collections;
17:
18: import org.eclipse.emf.ecore.EClass;
19: import org.eclipse.emf.ecp.view.spi.rule.ConditionService;
20: import org.eclipse.emf.ecp.view.spi.rule.model.Condition;
21: import org.eclipse.emf.ecp.view.spi.rule.model.NotCondition;
22: import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
23: import org.osgi.service.component.annotations.Component;
24:
25: /**
26: * Condition service for the {@link NotCondition}.
27: *
28: * @author Christian W. Damus
29: */
30: @Component(service = ConditionService.class)
31: public class NotConditionService extends CompositeConditionService<NotCondition> {
32:
33:         /**
34:          * Initializes me.
35:          */
36:         public NotConditionService() {
37:                 super();
38:         }
39:
40:         @Override
41:         public EClass getConditionType() {
42:                 return RulePackage.Literals.NOT_CONDITION;
43:         }
44:
45:         @Override
46:         protected Iterable<? extends Condition> components(NotCondition condition) {
47:                 final Condition result = condition.getCondition();
48:•                if (result == null) {
49:                         return Collections.emptyList();
50:                 }
51:                 return Collections.singletonList(result);
52:         }
53:
54: }