blob: ecfefcf95e643fd8d962bc091cba699dd46276e2 (
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
|
package tools.refinery.store.query.term;
import org.jetbrains.annotations.Nullable;
import tools.refinery.store.query.equality.LiteralEqualityHelper;
import java.util.Set;
public abstract sealed class AnyDataVariable extends Variable implements AnyTerm permits DataVariable {
protected AnyDataVariable(String name) {
super(name);
}
@Override
public NodeVariable asNodeVariable() {
throw new IllegalStateException("%s is a data variable".formatted(this));
}
@Override
public boolean equalsWithSubstitution(LiteralEqualityHelper helper, AnyTerm other) {
return other instanceof AnyDataVariable dataVariable && helper.variableEqual(this, dataVariable);
}
@Override
public Set<AnyDataVariable> getInputVariables() {
return Set.of(this);
}
@Override
public abstract AnyDataVariable renew(@Nullable String name);
@Override
public abstract AnyDataVariable renew();
}
|