-
Notifications
You must be signed in to change notification settings - Fork 85
/
IGetAllQueries.java
73 lines (65 loc) · 2.58 KB
/
IGetAllQueries.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
* Copyright (c) 2006, 2020 THALES GLOBAL SERVICES.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Thales - initial API and implementation
*******************************************************************************/
package org.polarsys.capella.common.helpers.query;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
/**
* Retrieve EObject instances corresponding to a type and accessible from a source object by successive compositions.
* @version 0.1.0
*/
public interface IGetAllQueries {
/**
* Retrieve EObject instances corresponding to a type and accessible from a source object by successive compositions
* @param source
* element from which the search starts
* @param targetType
* discriminating type
*/
public Set<EObject> getAll(EObject source, Class<?> targetType);
/**
* Retrieve EObject instances corresponding to a type and accessible from a source object by successive compositions
*
* @param source
* element from which the search starts
* @param targetType
* discriminating type
*/
public Set<EObject> getAll(EObject source, EClass targetType);
/**
* Retrieve EObject instances corresponding to a type and accessible from a source object by successive compositions
*
* @param source
* element from which the search starts
* @param predicate
* discriminating predicate
*/
public Set<EObject> getAll(EObject source, Predicate<EObject> predicate);
/**
* Retrieve recursively EObject instances corresponding to a type and accessible from a source object by successive compositions
*
* @param source element from which the search starts
* @param targetType discriminating type
* @param filter list of the classes excluded from the getAll query
*/
public Set<EObject> getAllFiltered(EObject source, EClass targetType, List<EClass> filter) ;
/**
* Retrieve EClasses that have the given EClass as super type.
* TODO : getAllSubTypes with nspace param in case user wants to browse some metamodel extensions !!!
* @param eClass supertype
* @return sub types
*/
public List<EClass> getLocalSubTypes(EClass eClass);
}