KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > expression > ExpressionVisitor


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.expression;
6
7 import org.h2.table.Table;
8
9 public class ExpressionVisitor {
10     // Is the value independent on unset parameters or on columns of a higher level query, or sequence values (that means can it be evaluated right now)
11
public static final int INDEPENDENT = 0;
12     
13     // Are all aggregates MIN(column), MAX(column), or COUNT(*)?
14
public static final int OPTIMIZABLE_MIN_MAX_COUNT_ALL = 1;
15     
16     // Does the expression return the same results for the same parameters?
17
public static final int DETERMINISTIC = 2;
18     
19     // Can the expression be evaluated, that means are all columns set to 'evaluatable'?
20
public static final int EVALUATABLE = 3;
21     
22     // Request to set the latest modification id
23
public static final int SET_MAX_DATA_MODIFICATION_ID = 4;
24
25     // Does the expression have no side effects (change the data)?
26
public static final int READONLY = 5;
27
28     int queryLevel;
29     public Table table;
30     public int type;
31     private long maxDataModificationId;
32     
33     public static ExpressionVisitor get(int type) {
34         return new ExpressionVisitor(type);
35     }
36     
37     public long getMaxDataModificationId() {
38         return maxDataModificationId;
39     }
40     
41     private ExpressionVisitor(int type) {
42         this.type = type;
43     }
44     
45     public void queryLevel(int offset) {
46         queryLevel += offset;
47     }
48
49     public void addDataModificationId(long v) {
50         maxDataModificationId = Math.max(maxDataModificationId, v);
51     }
52
53 }
54
Popular Tags