diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/registry/IRegistryView.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/registry/IRegistryView.java | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/registry/IRegistryView.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/registry/IRegistryView.java new file mode 100644 index 00000000..acf49b76 --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/registry/IRegistryView.java | |||
@@ -0,0 +1,72 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2016, Abel Hegedus, IncQuery Labs Ltd. | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.registry; | ||
10 | |||
11 | import java.util.Set; | ||
12 | |||
13 | /** | ||
14 | * The registry view is the primary interface for users to interact with the query specifications in an | ||
15 | * {@link IQuerySpecificationRegistry}. Views are created using the createView methods of registry and their content is | ||
16 | * also dynamically updated by the registry. | ||
17 | * | ||
18 | * The view contains a set of {@link IQuerySpecificationRegistryEntry} objects that can be used to access the query | ||
19 | * specifications themselves through the get() method. | ||
20 | * | ||
21 | * Users can check the contents of the view and add listeners to get notifications on view changes (added or removed | ||
22 | * entries). | ||
23 | * | ||
24 | * @author Abel Hegedus | ||
25 | * @since 1.3 | ||
26 | * | ||
27 | */ | ||
28 | public interface IRegistryView extends IQuerySpecificationRegistryChangeListener { | ||
29 | |||
30 | /** | ||
31 | * @return an immutable copy of all entries found in the view | ||
32 | */ | ||
33 | Iterable<IQuerySpecificationRegistryEntry> getEntries(); | ||
34 | |||
35 | /** | ||
36 | * @return the set of FQNs for the query specifications in the view | ||
37 | */ | ||
38 | Set<String> getQuerySpecificationFQNs(); | ||
39 | |||
40 | /** | ||
41 | * @param fullyQualifiedName | ||
42 | * that is looked up in the view | ||
43 | * @return true if the view contains an entry with given FQN, false otherwise | ||
44 | */ | ||
45 | boolean hasQuerySpecificationFQN(String fullyQualifiedName); | ||
46 | |||
47 | /** | ||
48 | * @param fullyQualifiedName | ||
49 | * of the entries that are requested | ||
50 | * @return the possible empty set of entries with the given FQN | ||
51 | */ | ||
52 | Set<IQuerySpecificationRegistryEntry> getEntries(String fullyQualifiedName); | ||
53 | |||
54 | /** | ||
55 | * Adds a listener to the view that will be notified when an entry is added to or removed from the view. | ||
56 | * | ||
57 | * @param listener that is added | ||
58 | */ | ||
59 | void addViewListener(IQuerySpecificationRegistryChangeListener listener); | ||
60 | |||
61 | /** | ||
62 | * Removes a listener that was previously added to the view. | ||
63 | * | ||
64 | * @param listener that is removed | ||
65 | */ | ||
66 | void removeViewListener(IQuerySpecificationRegistryChangeListener listener); | ||
67 | |||
68 | /** | ||
69 | * @return the registry underlying the view | ||
70 | */ | ||
71 | IQuerySpecificationRegistry getRegistry(); | ||
72 | } | ||