Source Code Cross Referenced for FormulaRecordAggregate.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » hssf » record » aggregates » 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.aggregates 
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.aggregates;
019:
020:        import org.apache.poi.hssf.record.*;
021:
022:        /**
023:         * The formula record aggregate is used to join together the formula record and it's
024:         * (optional) string record and (optional) Shared Formula Record (template reads, excel optimization).
025:         *
026:         * @author Glen Stampoultzis (glens at apache.org)
027:         */
028:        public class FormulaRecordAggregate extends Record implements 
029:                CellValueRecordInterface, Comparable {
030:            public final static short sid = -2000;
031:
032:            private FormulaRecord formulaRecord;
033:            private StringRecord stringRecord;
034:
035:            public FormulaRecordAggregate(FormulaRecord formulaRecord,
036:                    StringRecord stringRecord) {
037:                this .formulaRecord = formulaRecord;
038:                this .stringRecord = stringRecord;
039:            }
040:
041:            protected void validateSid(short id) {
042:            }
043:
044:            protected void fillFields(RecordInputStream in) {
045:            }
046:
047:            /**
048:             * called by the class that is responsible for writing this sucker.
049:             * Subclasses should implement this so that their data is passed back in a
050:             * byte array.
051:             *
052:             * @param offset to begin writing at
053:             * @param data byte array containing instance data
054:             * @return number of bytes written
055:             */
056:
057:            public int serialize(int offset, byte[] data) {
058:                int pos = offset;
059:                pos += formulaRecord.serialize(pos, data);
060:
061:                if (stringRecord != null) {
062:                    pos += stringRecord.serialize(pos, data);
063:                }
064:                return pos - offset;
065:
066:            }
067:
068:            /**
069:             * gives the current serialized size of the record. Should include the sid and reclength (4 bytes).
070:             */
071:            public int getRecordSize() {
072:                int size = formulaRecord.getRecordSize()
073:                        + (stringRecord == null ? 0 : stringRecord
074:                                .getRecordSize());
075:                return size;
076:            }
077:
078:            /**
079:             * return the non static version of the id for this record.
080:             */
081:            public short getSid() {
082:                return sid;
083:            }
084:
085:            public void setStringRecord(StringRecord stringRecord) {
086:                this .stringRecord = stringRecord;
087:            }
088:
089:            public void setFormulaRecord(FormulaRecord formulaRecord) {
090:                this .formulaRecord = formulaRecord;
091:            }
092:
093:            public FormulaRecord getFormulaRecord() {
094:                return formulaRecord;
095:            }
096:
097:            public StringRecord getStringRecord() {
098:                return stringRecord;
099:            }
100:
101:            public boolean isEqual(CellValueRecordInterface i) {
102:                return formulaRecord.isEqual(i);
103:            }
104:
105:            public boolean isAfter(CellValueRecordInterface i) {
106:                return formulaRecord.isAfter(i);
107:            }
108:
109:            public boolean isBefore(CellValueRecordInterface i) {
110:                return formulaRecord.isBefore(i);
111:            }
112:
113:            public short getXFIndex() {
114:                return formulaRecord.getXFIndex();
115:            }
116:
117:            public void setXFIndex(short xf) {
118:                formulaRecord.setXFIndex(xf);
119:            }
120:
121:            public void setColumn(short col) {
122:                formulaRecord.setColumn(col);
123:            }
124:
125:            public void setRow(int row) {
126:                formulaRecord.setRow(row);
127:            }
128:
129:            public short getColumn() {
130:                return formulaRecord.getColumn();
131:            }
132:
133:            public int getRow() {
134:                return formulaRecord.getRow();
135:            }
136:
137:            public int compareTo(Object o) {
138:                return formulaRecord.compareTo(o);
139:            }
140:
141:            public boolean equals(Object obj) {
142:                return formulaRecord.equals(obj);
143:            }
144:
145:            public String toString() {
146:                return formulaRecord.toString();
147:            }
148:
149:            /**
150:             * @see java.lang.Object#clone()
151:             */
152:            public Object clone() {
153:                StringRecord clonedString = (stringRecord == null) ? null
154:                        : (StringRecord) stringRecord.clone();
155:
156:                return new FormulaRecordAggregate(
157:                        (FormulaRecord) this .formulaRecord.clone(),
158:                        clonedString);
159:            }
160:
161:            /* 
162:             * Setting to true so that this value does not abort the whole ValueAggregation
163:             * (non-Javadoc)
164:             * @see org.apache.poi.hssf.record.Record#isInValueSection()
165:             */
166:            public boolean isInValueSection() {
167:
168:                return true;
169:            }
170:
171:            public String getStringValue() {
172:                if (stringRecord == null)
173:                    return null;
174:                return stringRecord.getString();
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.