blob: fb8b3332eb9920a66cc45f30bbd146012036ebc2 (
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
|
package tools.refinery.store.query.literal;
import tools.refinery.store.query.Variable;
import tools.refinery.store.query.substitution.Substitution;
import tools.refinery.store.query.view.AnyRelationView;
import java.util.List;
public final class RelationViewLiteral extends CallLiteral<AnyRelationView>
implements PolarLiteral<RelationViewLiteral> {
public RelationViewLiteral(CallPolarity polarity, AnyRelationView target, List<Variable> arguments) {
super(polarity, target, arguments);
}
@Override
public Class<AnyRelationView> getTargetType() {
return AnyRelationView.class;
}
@Override
protected String targetToString() {
var target = getTarget();
return "@RelationView(\"%s\") %s".formatted(target.getViewName(), target.getSymbol().name());
}
@Override
public RelationViewLiteral substitute(Substitution substitution) {
return new RelationViewLiteral(getPolarity(), getTarget(), substituteArguments(substitution));
}
@Override
public RelationViewLiteral negate() {
return new RelationViewLiteral(getPolarity().negate(), getTarget(), getArguments());
}
}
|