Source Code Cross Referenced for BaseHDFImageMetadata.java in  » GIS » GeoTools-2.4.1 » it » geosolutions » imageio » plugins » jhdf » 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 » GIS » GeoTools 2.4.1 » it.geosolutions.imageio.plugins.jhdf 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package it.geosolutions.imageio.plugins.jhdf;
002:
003:        import javax.imageio.metadata.IIOMetadata;
004:        import javax.imageio.metadata.IIOMetadataNode;
005:
006:        import ncsa.hdf.object.Dataset;
007:
008:        public abstract class BaseHDFImageMetadata extends IIOMetadata {
009:
010:            /** The Dataset Name */
011:            protected String name = "";
012:
013:            /** The Dataset Rank */
014:            protected int rank = -1;
015:
016:            /** The Dataset Dims Sizes. 
017:             * As an Instance, a Dataset may have (x,y,z,t) respectively (3200,2000,10,5)
018:             */
019:            protected long dims[] = null;
020:
021:            /** The Dataset Chunk Size expressed as a String.
022:             * As an Instance, a 2D Dataset may have a chunk size of 512*512 
023:             * In such a case, chunkSize value is "512,512".
024:             * */
025:            protected long chunkSize[] = null;
026:
027:            public BaseHDFImageMetadata(
028:                    boolean standardMetadataFormatSupported,
029:                    String nativeMetadataFormatName,
030:                    String nativeMetadataFormatClassName,
031:                    String[] extraMetadataFormatNames,
032:                    String[] extraMetadataFormatClassNames) {
033:                super (standardMetadataFormatSupported,
034:                        nativeMetadataFormatName,
035:                        nativeMetadataFormatClassName,
036:                        extraMetadataFormatNames, extraMetadataFormatClassNames);
037:            }
038:
039:            /**
040:             * Returns a <code>IIOMetadataNode</code> which should be common to each
041:             * specific {@link BaseHDFImageMetada} extension since each HDF dataset 
042:             * has a Rank, a Name, a set of dims length.
043:             * 
044:             * @return the <code>IIOMetadataNode</code> common to each HDF metadata.
045:             */
046:            protected IIOMetadataNode getCommonDatasetNode() {
047:                //The generated Node is common to each HDF metadata structure.
048:
049:                /*
050:                 * root
051:                 *   +-- datasetProperties (Name, Rank, Dims, ChunkSize)
052:                 */
053:
054:                final IIOMetadataNode datasetNode = new IIOMetadataNode(
055:                        "DatasetProperties");
056:                datasetNode.setAttribute("Name", name);
057:                datasetNode.setAttribute("Rank", Integer.toString(rank));
058:
059:                String sDims = "";
060:                if (dims != null) {
061:                    final int dimsLength = dims.length;
062:                    final StringBuffer sb = new StringBuffer();
063:                    for (int i = 0; i < dimsLength; i++) {
064:                        sb.append(Long.toString(dims[i]));
065:                        if (i != dimsLength - 1)
066:                            sb.append(",");
067:                    }
068:                    sDims = sb.toString().trim();
069:                }
070:                datasetNode.setAttribute("Dims", sDims);
071:
072:                String sChunkSize = "";
073:                if (chunkSize != null) {
074:                    final int chunkSizeLength = chunkSize.length;
075:                    final StringBuffer sb = new StringBuffer();
076:                    for (int i = 0; i < chunkSizeLength; i++) {
077:                        sb.append(Long.toString(chunkSize[i]));
078:                        if (i != chunkSizeLength - 1)
079:                            sb.append(",");
080:                    }
081:                    sChunkSize = sb.toString().trim();
082:                }
083:
084:                datasetNode.setAttribute("ChunkSize", sChunkSize);
085:                //TODO: Should I add envelope?
086:                return datasetNode;
087:            }
088:
089:            protected void initializeCommonDatasetProperties(
090:                    SubDatasetInfo sdInfo) {
091:                //	 setting dims (array copy)
092:                final long dims[] = sdInfo.getDims();
093:                if (dims != null) {
094:                    final int dimsLength = dims.length;
095:                    this .dims = new long[dimsLength];
096:                    for (int i = 0; i < dimsLength; i++)
097:                        this .dims[i] = dims[i];
098:                }
099:
100:                // setting chunkSize (array copy)
101:                final long chunkSize[] = sdInfo.getChunkSize();
102:                if (chunkSize != null) {
103:                    final int chunkSizeLength = chunkSize.length;
104:                    this .chunkSize = new long[chunkSizeLength];
105:                    for (int i = 0; i < chunkSizeLength; i++)
106:                        this .chunkSize[i] = chunkSize[i];
107:                }
108:
109:                // setting rank
110:                this .rank = sdInfo.getRank();
111:
112:                // setting name
113:                this .name = sdInfo.getName();
114:            }
115:
116:            /**
117:             * Set properties common to each HDF format (not a specific "profile"). 
118:             * That is, any HDF dataset has a Rank, a Name, a set of dims length.
119:             * 
120:             * @param dataset
121:             */
122:            protected void initializeCommonDatasetProperties(Dataset dataset) {
123:                // setting dims (array copy)
124:                final long dims[] = dataset.getDims();
125:                if (dims != null) {
126:                    final int dimsLength = dims.length;
127:                    this .dims = new long[dimsLength];
128:                    for (int i = 0; i < dimsLength; i++)
129:                        this .dims[i] = dims[i];
130:                }
131:
132:                // setting chunkSize (array copy)
133:                final long chunkSize[] = dataset.getChunkSize();
134:                if (chunkSize != null) {
135:                    final int chunkSizeLength = chunkSize.length;
136:                    this .chunkSize = new long[chunkSizeLength];
137:                    for (int i = 0; i < chunkSizeLength; i++)
138:                        this .chunkSize[i] = chunkSize[i];
139:                }
140:
141:                // setting rank
142:                this .rank = dataset.getRank();
143:
144:                // setting name
145:                this.name = dataset.getName();
146:            }
147:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.