Source Code Cross Referenced for ExternSheetSubRecord.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hssf » record » 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 » Collaboration » poi 3.0.2 beta2 » org.apache.poi.hssf.record 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* ====================================================================
002:         Licensed to the Apache Software Foundation (ASF) under one or more
003:         contributor license agreements.  See the NOTICE file distributed with
004:         this work for additional information regarding copyright ownership.
005:         The ASF licenses this file to You under the Apache License, Version 2.0
006:         (the "License"); you may not use this file except in compliance with
007:         the License.  You may obtain a copy of the License at
008:
009:         http://www.apache.org/licenses/LICENSE-2.0
010:
011:         Unless required by applicable law or agreed to in writing, software
012:         distributed under the License is distributed on an "AS IS" BASIS,
013:         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         See the License for the specific language governing permissions and
015:         limitations under the License.
016:         ==================================================================== */
017:
018:        package org.apache.poi.hssf.record;
019:
020:        import org.apache.poi.util.LittleEndian;
021:
022:        /**
023:         * Title:        A sub Record for Extern Sheet <P>
024:         * Description:  Defines a named range within a workbook. <P>
025:         * REFERENCE:  <P>
026:         * @author Libin Roman (Vista Portal LDT. Developer)
027:         * @version 1.0-pre
028:         */
029:
030:        public class ExternSheetSubRecord extends Record {
031:            public final static short sid = 0xFFF; // only here for conformance, doesn't really have an sid
032:            private short field_1_index_to_supbook;
033:            private short field_2_index_to_first_supbook_sheet;
034:            private short field_3_index_to_last_supbook_sheet;
035:
036:            /** a Constractor for making new sub record
037:             */
038:            public ExternSheetSubRecord() {
039:            }
040:
041:            /**
042:             * Constructs a Extern Sheet Sub Record record and sets its fields appropriately.
043:             *
044:             * @param in the RecordInputstream to read the record from
045:             */
046:            public ExternSheetSubRecord(RecordInputStream in) {
047:                super (in);
048:            }
049:
050:            /** Sets the Index to the sup book
051:             * @param index sup book index
052:             */
053:            public void setIndexToSupBook(short index) {
054:                field_1_index_to_supbook = index;
055:            }
056:
057:            /** gets the index to sup book
058:             * @return sup book index
059:             */
060:            public short getIndexToSupBook() {
061:                return field_1_index_to_supbook;
062:            }
063:
064:            /** sets the index to first sheet in supbook
065:             * @param index index to first sheet
066:             */
067:            public void setIndexToFirstSupBook(short index) {
068:                field_2_index_to_first_supbook_sheet = index;
069:            }
070:
071:            /** gets the index to first sheet from supbook
072:             * @return index to first supbook
073:             */
074:            public short getIndexToFirstSupBook() {
075:                return field_2_index_to_first_supbook_sheet;
076:            }
077:
078:            /** sets the index to last sheet in supbook
079:             * @param index index to last sheet
080:             */
081:            public void setIndexToLastSupBook(short index) {
082:                field_3_index_to_last_supbook_sheet = index;
083:            }
084:
085:            /** gets the index to last sheet in supbook
086:             * @return index to last supbook
087:             */
088:            public short getIndexToLastSupBook() {
089:                return field_3_index_to_last_supbook_sheet;
090:            }
091:
092:            /**
093:             * called by constructor, should throw runtime exception in the event of a
094:             * record passed with a differing ID.
095:             *
096:             * @param id alleged id for this record
097:             */
098:            protected void validateSid(short id) {
099:                // do nothing
100:            }
101:
102:            /**
103:             * @param in the RecordInputstream to read the record from
104:             */
105:            protected void fillFields(RecordInputStream in) {
106:                field_1_index_to_supbook = in.readShort();
107:                field_2_index_to_first_supbook_sheet = in.readShort();
108:                field_3_index_to_last_supbook_sheet = in.readShort();
109:            }
110:
111:            public String toString() {
112:                StringBuffer buffer = new StringBuffer();
113:                buffer.append("   supbookindex =").append(getIndexToSupBook())
114:                        .append('\n');
115:                buffer.append("   1stsbindex   =").append(
116:                        getIndexToFirstSupBook()).append('\n');
117:                buffer.append("   lastsbindex  =").append(
118:                        getIndexToLastSupBook()).append('\n');
119:                return buffer.toString();
120:            }
121:
122:            /**
123:             * called by the class that is responsible for writing this sucker.
124:             * Subclasses should implement this so that their data is passed back in a
125:             * byte array.
126:             *
127:             * @param offset to begin writing at
128:             * @param data byte array containing instance data
129:             * @return number of bytes written
130:             */
131:            public int serialize(int offset, byte[] data) {
132:                LittleEndian.putShort(data, 0 + offset, getIndexToSupBook());
133:                LittleEndian.putShort(data, 2 + offset,
134:                        getIndexToFirstSupBook());
135:                LittleEndian
136:                        .putShort(data, 4 + offset, getIndexToLastSupBook());
137:
138:                return getRecordSize();
139:            }
140:
141:            /** returns the record size
142:             */
143:            public int getRecordSize() {
144:                return 6;
145:            }
146:
147:            /**
148:             * return the non static version of the id for this record.
149:             */
150:            public short getSid() {
151:                return sid;
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.