1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package jTrolog.terms;
23
24
25
26
27 @SuppressWarnings({ "serial" })
28 public class WrapVar extends Var implements Wrapper {
29
30 Var basis;
31 int context;
32 String[] nameNumbers;
33
34 public WrapVar(Var var, int renameVarID) {
35 if (var instanceof WrapVar)
36 throw new RuntimeException("building a WrapVar from another WrapVar");
37 basis = var;
38 context = renameVarID;
39 }
40
41 public boolean equals(Object t) {
42 return t instanceof WrapVar && context == ((WrapVar) t).context && basis.equals(((WrapVar) t).basis);
43 }
44
45 public int hashCode() {
46 return basis.hashCode() + context * 100;
47 }
48
49 public boolean isAnonymous() {
50 return basis.isAnonymous();
51 }
52
53 public String toString() {
54 return basis.toString();
55 }
56
57 public String toStringSmall() {
58 return basis.toStringSmall();
59 }
60
61 public int getContext() {
62 return context;
63 }
64
65 public Term getBasis() {
66 return basis;
67 }
68 }