Source Code Cross Referenced for EscherSimpleProperty.java in  » Collaboration » poi-3.0.2-beta2 » org » apache » poi » ddf » 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.ddf 
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.ddf;
019:
020:        import org.apache.poi.util.LittleEndian;
021:        import org.apache.poi.util.HexDump;
022:
023:        /**
024:         * A simple property is of fixed length and as a property number in addition
025:         * to a 32-bit value.  Properties that can't be stored in only 32-bits are
026:         * stored as EscherComplexProperty objects.
027:         *
028:         * @author Glen Stampoultzis (glens at apache.org)
029:         */
030:        public class EscherSimpleProperty extends EscherProperty {
031:            protected int propertyValue;
032:
033:            /**
034:             * The id is distinct from the actual property number.  The id includes the property number the blip id
035:             * flag and an indicator whether the property is complex or not.
036:             */
037:            public EscherSimpleProperty(short id, int propertyValue) {
038:                super (id);
039:                this .propertyValue = propertyValue;
040:            }
041:
042:            /**
043:             * Constructs a new escher property.  The three parameters are combined to form a property
044:             * id.
045:             */
046:            public EscherSimpleProperty(short propertyNumber,
047:                    boolean isComplex, boolean isBlipId, int propertyValue) {
048:                super (propertyNumber, isComplex, isBlipId);
049:                this .propertyValue = propertyValue;
050:            }
051:
052:            /**
053:             * Serialize the simple part of the escher record.
054:             *
055:             * @return the number of bytes serialized.
056:             */
057:            public int serializeSimplePart(byte[] data, int offset) {
058:                LittleEndian.putShort(data, offset, getId());
059:                LittleEndian.putInt(data, offset + 2, propertyValue);
060:                return 6;
061:            }
062:
063:            /**
064:             * Escher properties consist of a simple fixed length part and a complex variable length part.
065:             * The fixed length part is serialized first.
066:             */
067:            public int serializeComplexPart(byte[] data, int pos) {
068:                return 0;
069:            }
070:
071:            /**
072:             * @return  Return the 32 bit value of this property.
073:             */
074:            public int getPropertyValue() {
075:                return propertyValue;
076:            }
077:
078:            /**
079:             * Returns true if one escher property is equal to another.
080:             */
081:            public boolean equals(Object o) {
082:                if (this  == o)
083:                    return true;
084:                if (!(o instanceof  EscherSimpleProperty))
085:                    return false;
086:
087:                final EscherSimpleProperty escherSimpleProperty = (EscherSimpleProperty) o;
088:
089:                if (propertyValue != escherSimpleProperty.propertyValue)
090:                    return false;
091:                if (getId() != escherSimpleProperty.getId())
092:                    return false;
093:
094:                return true;
095:            }
096:
097:            /**
098:             * Returns a hashcode so that this object can be stored in collections that
099:             * require the use of such things.
100:             */
101:            public int hashCode() {
102:                return propertyValue;
103:            }
104:
105:            /**
106:             * @return the string representation of this property.
107:             */
108:            public String toString() {
109:                return "propNum: " + getPropertyNumber() + ", RAW: 0x"
110:                        + HexDump.toHex(getId()) + ", propName: "
111:                        + EscherProperties.getPropertyName(getPropertyNumber())
112:                        + ", complex: " + isComplex() + ", blipId: "
113:                        + isBlipId() + ", value: " + propertyValue + " (0x"
114:                        + HexDump.toHex(propertyValue) + ")";
115:            }
116:
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.