aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-query/src/main/java/tools/refinery/store/query/view/AnySymbolView.java
blob: 7e9bf6df5772e6ce6a9ddac866c349c3afba4b0b (plain) (blame)
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
/*
 * SPDX-FileCopyrightText: 2021-2023 The Refinery Authors <https://refinery.tools/>
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package tools.refinery.store.query.view;

import tools.refinery.store.model.Model;
import tools.refinery.store.query.dnf.FunctionalDependency;
import tools.refinery.store.representation.AnySymbol;
import tools.refinery.store.query.Constraint;

import java.util.Set;

public sealed interface AnySymbolView extends Constraint permits SymbolView {
	AnySymbol getSymbol();

	String getViewName();

	default Set<FunctionalDependency<Integer>> getFunctionalDependencies() {
		return Set.of();
	}

	default Set<ViewImplication> getImpliedRelationViews() {
		return Set.of();
	}

	boolean get(Model model, Object[] tuple);

	Iterable<Object[]> getAll(Model model);

	default Iterable<Object[]> getAdjacent(Model model, int slot, Object value) {
		throw new IllegalArgumentException("Cannot index slot " + slot);
	}

	default boolean canIndexSlot(int slot) {
		return false;
	}
}