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


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.access.btree.index.B2IStaticCompiledInfo
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.btree.index;
023:
024:        import org.apache.derby.iapi.services.io.ArrayInputStream;
025:
026:        import org.apache.derby.iapi.services.monitor.Monitor;
027:
028:        import org.apache.derby.iapi.services.io.FormatIdUtil;
029:        import org.apache.derby.iapi.services.io.StoredFormatIds;
030:
031:        import org.apache.derby.iapi.error.StandardException;
032:
033:        import org.apache.derby.iapi.store.access.conglomerate.Conglomerate;
034:
035:        import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;
036:        import org.apache.derby.iapi.store.access.TransactionController;
037:
038:        import org.apache.derby.iapi.types.DataValueDescriptor;
039:
040:        import java.io.IOException;
041:        import java.io.ObjectInput;
042:        import java.io.ObjectOutput;
043:
044:        /**
045:
046:         This class implements the static compiled information relevant to a btree
047:         secondary index.  It is what is returned by 
048:         B2I.getStaticCompiledOpenConglomInfo().
049:         <p>
050:         Currently the only interesting information stored is Conglomerate for this
051:         index and the Conglomerate for the base table of this conglomerate.
052:
053:         **/
054:
055:        public class B2IStaticCompiledInfo implements 
056:                StaticCompiledOpenConglomInfo {
057:
058:            /**************************************************************************
059:             * Fields of the class 
060:             **************************************************************************
061:             */
062:
063:            /**
064:             * Conglomerate data structure for this index.
065:             **/
066:            B2I b2i;
067:
068:            /**
069:             * Conglomerate data structure for this base table of this index.
070:             **/
071:            StaticCompiledOpenConglomInfo base_table_static_info;
072:
073:            /**************************************************************************
074:             * Constructors for This class:
075:             **************************************************************************
076:             */
077:
078:            /**
079:             * Empty arg constructor used by the monitor to create object to read into.
080:             **/
081:            public B2IStaticCompiledInfo() {
082:            }
083:
084:            /**
085:             * Constructor used to build class from scratch.
086:             * <p>
087:             * @param b2i    the btree Conglomerate that we are compiling.
088:             **/
089:            B2IStaticCompiledInfo(TransactionController tc, B2I b2i)
090:                    throws StandardException {
091:                this .b2i = b2i;
092:
093:                this .base_table_static_info = tc
094:                        .getStaticCompiledConglomInfo(b2i.baseConglomerateId);
095:            }
096:
097:            /**************************************************************************
098:             * Private/Protected methods of This class:
099:             **************************************************************************
100:             */
101:
102:            /**************************************************************************
103:             * Public Methods of This class:
104:             **************************************************************************
105:             */
106:
107:            /**************************************************************************
108:             * Public Methods of StaticCompiledOpenConglomInfo Interface:
109:             **************************************************************************
110:             */
111:
112:            /**
113:             * return the "Conglomerate".
114:             * <p>
115:             * For secondaryindex compiled info return the secondary index conglomerate.
116:             * <p>
117:             *
118:             * @return the secondary index Conglomerate Object.
119:             **/
120:            public DataValueDescriptor getConglom() {
121:                return (b2i);
122:            }
123:
124:            /**************************************************************************
125:             * Public Methods of Storable Interface (via StaticCompiledOpenConglomInfo):
126:             *     This class is responsible for re/storing its own state.
127:             **************************************************************************
128:             */
129:
130:            /**
131:            Return whether the value is null or not.
132:            The containerid being zero is what determines nullness;  subclasses
133:            are not expected to override this method.
134:            @see org.apache.derby.iapi.services.io.Storable#isNull
135:             **/
136:            public boolean isNull() {
137:                return (b2i == null);
138:            }
139:
140:            /**
141:            Restore the in-memory representation to the null value.
142:            The containerid being zero is what determines nullness;  subclasses
143:            are not expected to override this method.
144:
145:            @see org.apache.derby.iapi.services.io.Storable#restoreToNull
146:             **/
147:            public void restoreToNull() {
148:                b2i = null;
149:            }
150:
151:            /**
152:             * Return my format identifier.
153:             *
154:             * @see org.apache.derby.iapi.services.io.TypedFormat#getTypeFormatId
155:             **/
156:            public int getTypeFormatId() {
157:                return StoredFormatIds.ACCESS_B2I_STATIC_COMPILED_V1_ID;
158:            }
159:
160:            /**
161:            Restore the in-memory representation from the stream.
162:
163:            @exception ClassNotFoundException Thrown if the stored representation is
164:            serialized and a class named in the stream could not be found.
165:
166:            @exception IOException thrown by readObject()
167:
168:            
169:            @see java.io.Externalizable#readExternal
170:             */
171:            public void readExternal(ObjectInput in) throws IOException,
172:                    ClassNotFoundException {
173:                // read in the B2I
174:                b2i = new B2I();
175:                b2i.readExternal(in);
176:
177:                // read in base table conglomerate
178:                base_table_static_info = (StaticCompiledOpenConglomInfo) in
179:                        .readObject();
180:            }
181:
182:            public void readExternalFromArray(ArrayInputStream in)
183:                    throws IOException, ClassNotFoundException {
184:                // read in the B2I
185:                b2i = new B2I();
186:                b2i.readExternal(in);
187:
188:                // read in base table conglomerate
189:                base_table_static_info = (StaticCompiledOpenConglomInfo) in
190:                        .readObject();
191:            }
192:
193:            /**
194:            Store the stored representation of the column value in the stream.
195:            It might be easier to simply store the properties - which would certainly
196:            make upgrading easier.
197:
198:            @exception IOException thrown by writeObject()
199:
200:             */
201:            public void writeExternal(ObjectOutput out) throws IOException {
202:                // first write the B2I object (the type we "know")
203:                b2i.writeExternal(out);
204:
205:                // write Conglomerate object as an object
206:                out.writeObject(base_table_static_info);
207:            }
208:        }
ww_w__.___j___a_v__a__2s_.c_om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.