Source Code Cross Referenced for VarNode.java in  » Testing » PolePosition-0.20 » com » versant » core » jdo » query » 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 » Testing » PolePosition 0.20 » com.versant.core.jdo.query 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998 - 2005 Versant Corporation
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         * Versant Corporation - initial API and implementation
010:         */
011:        package com.versant.core.jdo.query;
012:
013:        import com.versant.core.metadata.ClassMetaData;
014:        import com.versant.core.metadata.FieldMetaData;
015:        import com.versant.core.common.Debug;
016:        import com.versant.core.common.CmdBitSet;
017:
018:        /**
019:         * A variable declaration.
020:         */
021:        public class VarNode extends LeafNode implements  VarNodeIF {
022:
023:            private String type;
024:            private String identifier;
025:            private Class cls;
026:            private ClassMetaData cmd;
027:            private Object storeExtent;
028:            private FieldMetaData fmd;
029:            private Object fieldExtent;
030:            public boolean bound;
031:
032:            /**
033:             * If this variable is present in the result projection
034:             */
035:            private boolean usedInProjection;
036:
037:            public VarNode() {
038:            }
039:
040:            public Object accept(NodeVisitor visitor, Object[] results) {
041:                return visitor.visitVarNode(this , results);
042:            }
043:
044:            public String toString() {
045:                StringBuffer s = new StringBuffer();
046:                s.append(super .toString());
047:                s.append(' ');
048:                if (cls != null)
049:                    s.append(cls);
050:                else
051:                    s.append(type);
052:                s.append(' ');
053:                s.append(identifier);
054:                s.append(' ');
055:                s.append(bound ? "bound" : "unbound");
056:                return s.toString();
057:            }
058:
059:            public Field visit(MemVisitor visitor, Object obj) {
060:                return visitor.visitVarNode(this , obj);
061:            }
062:
063:            public String getType() {
064:                return type;
065:            }
066:
067:            public void setType(String type) {
068:                this .type = type;
069:            }
070:
071:            public String getIdentifier() {
072:                return identifier;
073:            }
074:
075:            public void setIdentifier(String identifier) {
076:                this .identifier = identifier;
077:            }
078:
079:            public Class getCls() {
080:                return cls;
081:            }
082:
083:            public void setCls(Class cls) {
084:                this .cls = cls;
085:            }
086:
087:            public ClassMetaData getCmd() {
088:                return cmd;
089:            }
090:
091:            public void setCmd(ClassMetaData cmd) {
092:                this .cmd = cmd;
093:            }
094:
095:            public void resolve(QueryParser comp) {
096:                cls = comp.resolveVarType(type);
097:                cmd = comp.getCMD(cls);
098:            }
099:
100:            public Object getStoreExtent() {
101:                return storeExtent;
102:            }
103:
104:            public void setStoreExtent(Object storeExtent) {
105:                this .storeExtent = storeExtent;
106:            }
107:
108:            public void setFieldExtent(Object fieldExtent) {
109:                this .fieldExtent = fieldExtent;
110:            }
111:
112:            public void setFmd(FieldMetaData fmd) {
113:                this .fmd = fmd;
114:            }
115:
116:            /**
117:             * Insert a VarBindingNode for us into the tree before sibling (i.e.
118:             * sibling.parent == varbindingnode.parent && varbindingnode.next = sibling).
119:             * This is used to "bind" unbound variables to the extent of the variables
120:             * class.
121:             */
122:            public void insertVarBindingNode(Node sibling) {
123:                // 'and' our sibling with a VarBindingNode to bind us to the
124:                // variables extent
125:                if (sibling.parent.getClass() == AndNode.class) {
126:                    AndNode and = (AndNode) sibling.parent;
127:                    and.insertChildBefore(sibling, new VarBindingNode(this ));
128:                } else {
129:                    AndNode and = new AndNode();
130:                    sibling.parent.replaceChild(sibling, and);
131:                    and.childList = new VarBindingNode(this );
132:                    and.childList.parent = and;
133:                    and.childList.next = sibling;
134:                    sibling.parent = and;
135:                }
136:                bound = true;
137:                if (Debug.DEBUG) {
138:                    System.out.println("### Added VarBindingNode for " + this );
139:                }
140:            }
141:
142:            /**
143:             * Implement this in nodes to udpate the ClassMetaData depency of the graph.
144:             * This is used for query eviction.
145:             *
146:             * @param bitSet
147:             */
148:            public void updateEvictionDependency(CmdBitSet bitSet) {
149:                if (cmd == null)
150:                    return;
151:                bitSet.addPlus(cmd);
152:            }
153:
154:            public void setUsedInProjection(boolean usedInProjection) {
155:                this .usedInProjection = usedInProjection;
156:            }
157:
158:            public boolean isUsedInProjection() {
159:                return usedInProjection;
160:            }
161:
162:            public VarNode getVarNode() {
163:                return this ;
164:            }
165:
166:            public Object getFieldExtent() {
167:                return fieldExtent;
168:            }
169:
170:            public FieldMetaData getFmd() {
171:                return fmd;
172:            }
173:
174:            public Object arrive(NodeVisitor v, Object msg) {
175:                return v.arriveVarNode(this, msg);
176:            }
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.