Source Code Cross Referenced for ExpressionVisitor.java in  » Database-DBMS » h2database » org » h2 » expression » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » h2database » org.h2.expression 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
003:         * (http://h2database.com/html/license.html).
004:         * Initial Developer: H2 Group
005:         */
006:        package org.h2.expression;
007:
008:        import java.util.HashSet;
009:
010:        import org.h2.engine.DbObject;
011:        import org.h2.table.ColumnResolver;
012:        import org.h2.table.Table;
013:
014:        /**
015:         * The visitor pattern is used to iterate through all expressions of a query
016:         * to optimize a statement.
017:         */
018:        public class ExpressionVisitor {
019:
020:            /**
021:             * Is the value independent on unset parameters or on columns of a higher
022:             * level query, or sequence values (that means can it be evaluated right
023:             * now)?
024:             */
025:            public static final int INDEPENDENT = 0;
026:
027:            /**
028:             * Are all aggregates MIN(column), MAX(column), or COUNT(*)?
029:             */
030:            public static final int OPTIMIZABLE_MIN_MAX_COUNT_ALL = 1;
031:
032:            /**
033:             * Does the expression return the same results for the same parameters?
034:             */
035:            public static final int DETERMINISTIC = 2;
036:
037:            /**
038:             * Can the expression be evaluated, that means are all columns set to
039:             * 'evaluatable'?
040:             */
041:            public static final int EVALUATABLE = 3;
042:
043:            /**
044:             * Request to set the latest modification id.
045:             */
046:            public static final int SET_MAX_DATA_MODIFICATION_ID = 4;
047:
048:            /**
049:             * Does the expression have no side effects (change the data)?
050:             */
051:            public static final int READONLY = 5;
052:
053:            /**
054:             * Does an expression have no relation to the given table filter?
055:             */
056:            public static final int NOT_FROM_RESOLVER = 6;
057:
058:            /**
059:             * Request to get the set of dependencies.
060:             */
061:            public static final int GET_DEPENDENCIES = 7;
062:
063:            int queryLevel;
064:            public Table table;
065:            public int type;
066:            private long maxDataModificationId;
067:            private ColumnResolver resolver;
068:            private HashSet dependencies;
069:
070:            public static ExpressionVisitor get(int type) {
071:                return new ExpressionVisitor(type);
072:            }
073:
074:            public long getMaxDataModificationId() {
075:                return maxDataModificationId;
076:            }
077:
078:            public void addDependency(DbObject obj) {
079:                dependencies.add(obj);
080:            }
081:
082:            public HashSet getDependencies() {
083:                return dependencies;
084:            }
085:
086:            public void setDependencies(HashSet dependencies) {
087:                this .dependencies = dependencies;
088:            }
089:
090:            private ExpressionVisitor(int type) {
091:                this .type = type;
092:            }
093:
094:            public void queryLevel(int offset) {
095:                queryLevel += offset;
096:            }
097:
098:            public ColumnResolver getResolver() {
099:                return resolver;
100:            }
101:
102:            public void addDataModificationId(long v) {
103:                maxDataModificationId = Math.max(maxDataModificationId, v);
104:            }
105:
106:            public static ExpressionVisitor getNotFromResolver(
107:                    ColumnResolver resolver) {
108:                ExpressionVisitor v = new ExpressionVisitor(NOT_FROM_RESOLVER);
109:                v.resolver = resolver;
110:                return v;
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.