-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompPredicateInfo.java
More file actions
52 lines (39 loc) · 1.01 KB
/
Copy pathCompPredicateInfo.java
File metadata and controls
52 lines (39 loc) · 1.01 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.ArrayList;
public class CompPredicateInfo {
public Operand co1;
public String op; // one of "<" ">" "=" ">=" "<=" "!="
public Operand co2;
public CompPredicateInfo(Operand left, String mid, Operand right)
{
co1 = left;
op = mid;
co2 = right;
}
public String toString()
{
String s = "";
if (co1 == null)
s += "future";
else
s += co1.toString();
s += op;
if (co2 == null)
s += "future";
else
s += co2.toString();
return s;
}
public Bool3 eval(ArrayList<String> tNames, ArrayList<TableColumns> froml,
ArrayList<NameInfo> sell, int count, ProductRow pr) throws MyError {
CellInfo res1 = co1.eval(tNames, froml, sell, count, pr);
CellInfo res2 = co2.eval(tNames, froml, sell, count, pr);
if (res1 == null || res2 == null)
{
DBProcessor.debug(toString() + " is future");
return new Bool3(Bool3.FUTURE);
}
Bool3 result = res1.compareCell(res2, op);
DBProcessor.debug(toString() + " is " + result.toString());
return result;
}
}