aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-partial/src/main/java/tools/refinery/store/partial/translator/typehierarchy/InferredMustTypeRelationView.java
blob: 4eca0a1c9dc267d288d90e59b1c5d08eaef40bf9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package tools.refinery.store.partial.translator.typehierarchy;

import tools.refinery.store.partial.representation.PartialRelation;
import tools.refinery.store.query.view.TuplePreservingRelationView;
import tools.refinery.store.tuple.Tuple;

class InferredMustTypeRelationView extends TuplePreservingRelationView<InferredType> {
	private final PartialRelation type;

	InferredMustTypeRelationView(PartialRelation type) {
		super(TypeHierarchyTranslationUnit.INFERRED_TYPE_SYMBOL, "%s#must".formatted(type));
		this.type = type;
	}

	@Override
	public boolean filter(Tuple key, InferredType value) {
		return value.mustTypes().contains(type);
	}
}