Source Code Cross Referenced for OpenConglomerateScratchSpace.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » access » conglomerate » 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 » db derby 10.2 » org.apache.derby.impl.store.access.conglomerate 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.access.conglomerate.OpenConglomerateScratchSpace
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.store.access.conglomerate;
023:
024:        import org.apache.derby.iapi.error.StandardException;
025:
026:        import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;
027:        import org.apache.derby.iapi.store.access.RowUtil;
028:
029:        import org.apache.derby.iapi.types.DataValueDescriptor;
030:
031:        import org.apache.derby.iapi.services.io.FormatableBitSet;
032:        import org.apache.derby.iapi.services.loader.InstanceGetter;
033:
034:        /**
035:
036:         A utility class to store and use temporary scratch space associated with
037:         a conglomerate.
038:
039:         **/
040:
041:        public class OpenConglomerateScratchSpace implements 
042:                DynamicCompiledOpenConglomInfo {
043:
044:            /**************************************************************************
045:             * Fields of the class
046:             **************************************************************************
047:             */
048:
049:            /**
050:             * A template of info about the classes in the returned row.
051:             * <p>
052:             * This template is allocated on demand, and is used to efficiently
053:             * create new rows for export from this class.  This variable is for
054:             * use by get_row_for_export().
055:             **/
056:            private FormatableBitSet row_for_export_column_list;
057:            private InstanceGetter[] row_for_export_class_template;
058:
059:            /**
060:             * A Scratch template used for searching and qualifying rows in the 
061:             * conglomerate.  This is a full template, independent of the FormatableBitSet
062:             * used for access.
063:             **/
064:            private DataValueDescriptor[] scratch_template;
065:
066:            /**
067:             * A Scratch row used for qualifying rows in the 
068:             * conglomerate.  This is a row which matches the FormatableBitSet of rows being
069:             * returned.
070:             **/
071:            private DataValueDescriptor[] scratch_row;
072:
073:            /**
074:             * A complete array of format id's for this conglomerate.
075:             **/
076:            private int[] format_ids;
077:
078:            /**************************************************************************
079:             * Constructors for This class:
080:             **************************************************************************
081:             */
082:            public OpenConglomerateScratchSpace(int[] format_ids) {
083:                this .format_ids = format_ids;
084:            }
085:
086:            /**************************************************************************
087:             * Private/Protected methods of This class:
088:             **************************************************************************
089:             */
090:
091:            /**************************************************************************
092:             * Public Methods of This class:
093:             **************************************************************************
094:             */
095:
096:            /**
097:             * Return an empty template (possibly partial) row to be given back to 
098:             * a client.
099:             * <p>
100:             * The main use of this is for fetchSet() and fetchNextGroup() which
101:             * allocate rows and then give them back entirely to the caller.
102:             * <p>
103:             *
104:             * @return The row to use.
105:             *
106:             * @exception  StandardException  Standard exception policy.
107:             **/
108:            public DataValueDescriptor[] get_row_for_export()
109:                    throws StandardException {
110:                // Create a partial row class template template from the initial scan
111:                // parameters.
112:                if (row_for_export_class_template == null) {
113:                    row_for_export_class_template = RowUtil
114:                            .newClassInfoTemplate(row_for_export_column_list,
115:                                    format_ids);
116:                }
117:
118:                // Allocate a new row based on the class template.
119:                return (RowUtil
120:                        .newRowFromClassInfoTemplate(row_for_export_class_template));
121:            }
122:
123:            /**
124:             * Return an empty template (possibly partial) row to be used and 
125:             * reused internally for processing.
126:             * <p>
127:             * The main use of this is for qualifying rows where a row has not been
128:             * provided by the client.  This routine cache's a single row for reuse
129:             * by the caller, if the caller needs 2 concurrent scratch rows, some other
130:             * mechanism must be used.
131:             * <p>
132:             *
133:             * @return The row to use.
134:             *
135:             * @exception  StandardException  Standard exception policy.
136:             **/
137:            public DataValueDescriptor[] get_scratch_row()
138:                    throws StandardException {
139:                // Create a partial row class template template from the initial scan
140:                // parameters.
141:                if (scratch_row == null) {
142:                    scratch_row = get_row_for_export();
143:                }
144:
145:                // Allocate a new row based on the class template.
146:                return (scratch_row);
147:            }
148:
149:            /**
150:             * Return a complete empty row.  
151:             * <p>
152:             * The main use of this is for searching a tree where a complete copy of
153:             * the row is needed for searching.
154:             * <p>
155:             *
156:             * @return The template to use.
157:             *
158:             * @exception  StandardException  Standard exception policy.
159:             **/
160:            public DataValueDescriptor[] get_template()
161:                    throws StandardException {
162:                // Create a partial row class template from the initial scan parameters.
163:                if (scratch_template == null) {
164:                    scratch_template = TemplateRow.newRow(
165:                            (FormatableBitSet) null, format_ids);
166:                }
167:
168:                return (scratch_template);
169:            }
170:
171:            /**
172:             * Initialize scratch space for reuse by possibly different template.
173:             * <p>
174:             * Some data is only valid per statement.
175:             **/
176:            public void init(FormatableBitSet export_column_list) {
177:                row_for_export_class_template = null;
178:                row_for_export_column_list = null;
179:            }
180:        }
w_ww__.___ja__v_a_2_s_.___c_om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.