Source Code Cross Referenced for PT_CoordinatePoint.java in  » GIS » deegree » org » opengis » pt » 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 » deegree » org.opengis.pt 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/opengis/pt/PT_CoordinatePoint.java $
002:        /*
003:         * OpenGIS� Coordinate Transformation Services Implementation Specification
004:         * Copyright (2001) OpenGIS consortium
005:         *
006:         * THIS COPYRIGHT NOTICE IS A TEMPORARY PATCH.   Version 1.00 of official
007:         * OpenGIS's interface files doesn't contain a copyright notice yet. This
008:         * file is a slightly modified version of official OpenGIS's interface.
009:         * Changes have been done in order to fix RMI problems and are documented
010:         * on the SEAGIS web site (seagis.sourceforge.net). THIS FILE WILL LIKELY
011:         * BE REPLACED BY NEXT VERSION OF OPENGIS SPECIFICATIONS.
012:         */
013:        package org.opengis.pt;
014:
015:        // Various JDK's classes
016:        import java.io.Serializable;
017:        import java.util.Arrays;
018:
019:        /**
020:         * A position defined by a list of numbers. The ordinate values are indexed from
021:         * 0 to (<code>NumDim-1</code>), where <code>NumDim</code> is the
022:         * dimension of the coordinate system the coordinate point belongs in.
023:         * 
024:         * @version 1.01
025:         * @since 1.00
026:         * @author Martin Daly
027:         * @author Martin Desruisseaux
028:         */
029:        public class PT_CoordinatePoint implements  Cloneable, Serializable {
030:            /**
031:             * Use <code>serialVersionUID</code> from first draft for interoperability
032:             * with CSS 1.00.
033:             */
034:            private static final long serialVersionUID = -5747198890219811554L;
035:
036:            /**
037:             * The ordinates of the coordinate point.
038:             */
039:            public double[] ord;
040:
041:            /**
042:             * Construct an empty coordinate point. Caller must initialize {@link #ord}.
043:             */
044:            public PT_CoordinatePoint() {
045:            }
046:
047:            /**
048:             * Construct a 2D coordinate from the specified ordinates.
049:             */
050:            public PT_CoordinatePoint(final double x, final double y) {
051:                ord = new double[] { x, y };
052:            }
053:
054:            /**
055:             * Construct a 3D coordinate from the specified ordinates.
056:             */
057:            public PT_CoordinatePoint(final double x, final double y,
058:                    final double z) {
059:                ord = new double[] { x, y, z };
060:            }
061:
062:            /**
063:             * Returns a hash value for this coordinate. This value need not remain
064:             * consistent between different implementations of the same class.
065:             */
066:            public int hashCode() {
067:                long code = 326145729;
068:                if (ord != null) {
069:                    for (int i = ord.length; --i >= 0;)
070:                        code = code * 37 + Double.doubleToLongBits(ord[i]);
071:                }
072:                return (int) (code >>> 32) ^ (int) code;
073:            }
074:
075:            /**
076:             * Compares the specified object with this coordinate for equality.
077:             */
078:            public boolean equals(final Object object) {
079:                if (object != null && getClass().equals(object.getClass())) {
080:                    final PT_CoordinatePoint that = (PT_CoordinatePoint) object;
081:                    if (false) {
082:                        return Arrays.equals(this .ord, that.ord);
083:                        /*
084:                         * NOTE: The 'Arrays.equals(double[],double[])' method does not
085:                         * exists in JDK 1.1. If compatibility with JDK 1.1 is wanted,
086:                         * use the code below instead.
087:                         */
088:                    }
089:
090:                    if (this .ord == that.ord)
091:                        return true;
092:                    if (this .ord != null && that.ord != null) {
093:                        if (this .ord.length == that.ord.length) {
094:                            for (int i = ord.length; --i >= 0;)
095:                                if (Double.doubleToLongBits(this .ord[i]) != Double
096:                                        .doubleToLongBits(that.ord[i]))
097:                                    return false;
098:                            return true;
099:                        }
100:                    }
101:                }
102:                return false;
103:            }
104:
105:            /**
106:             * Returns a deep copy of this coordinate.
107:             */
108:            public Object clone() {
109:                try {
110:                    return super .clone();
111:                } catch (CloneNotSupportedException exception) {
112:                    // Should not happen, since we are cloneable.
113:                    throw new InternalError(exception.getMessage());
114:                }
115:            }
116:
117:            /**
118:             * Returns a string representation of this coordinate. The returned string
119:             * is implementation dependent. It is usually provided for debugging
120:             * purposes only.
121:             */
122:            public String toString() {
123:                final StringBuffer buffer = new StringBuffer(
124:                        "PT_CoordinatePoint");
125:                buffer.append('[');
126:                if (ord != null) {
127:                    for (int i = 0; i < ord.length; i++) {
128:                        if (i != 0)
129:                            buffer.append(", ");
130:                        buffer.append(ord[i]);
131:                    }
132:                }
133:                buffer.append(']');
134:                return buffer.toString();
135:            }
136:        }/* ********************************************************************
137:        Changes to this class. What the people have been up to:
138:        $Log$
139:        Revision 1.3  2006/07/13 06:28:31  poth
140:        comment footer added
141:
142:         ********************************************************************** */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.