Skip to content

Package: StructuralChangeSegmentTester

StructuralChangeSegmentTester

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 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: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.core.services.structuralchange;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecp.view.spi.model.ModelChangeNotification;
18: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReferenceSegment;
19:
20: /**
21: * A concrete structural change tester for a type of {@link VDomainModelReferenceSegment}.
22: *
23: * @author Lucas Koehler
24: * @since 1.19
25: *
26: */
27: public interface StructuralChangeSegmentTester {
28:         /**
29:          * The value that expresses that a {@link StructuralChangeSegmentTester} is not applicable for a
30:          * {@link VDomainModelReferenceSegment}.
31:          */
32:         double NOT_APPLICABLE = Double.NEGATIVE_INFINITY;
33:
34:         /**
35:          * Returns a double that expresses if and how suitable this tester is for the given
36:          * {@link VDomainModelReferenceSegment}.
37:          *
38:          * @param segment The {@link VDomainModelReferenceSegment}
39:          * @return The value indicating how suitable this tester is, negative infinity if it can't work with the given
40:          * {@link VDomainModelReferenceSegment}.
41:          */
42:         double isApplicable(VDomainModelReferenceSegment segment);
43:
44:         /**
45:          * Checks whether the domain structure of the given {@link VDomainModelReferenceSegment} has changed for the changes
46:          * indicated by the given {@link ModelChangeNotification}.
47:          *
48:          * @param segment The {@link VDomainModelReferenceSegment}
49:          * @param domainObject The domain object of the {@link VDomainModelReferenceSegment segment}.
50:          * @param notification The {@link ModelChangeNotification}
51:          * @return true if the domain structure has changed, false otherwise
52:          */
53:         boolean isStructureChanged(VDomainModelReferenceSegment segment, EObject domainObject,
54:                 ModelChangeNotification notification);
55:
56: }