Java Doc for DirectPosition2D.java in  » GIS » GeoTools-2.4.1 » org » geotools » geometry » 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 » org.geotools.geometry 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.geom.Point2D
      org.geotools.geometry.DirectPosition2D

All known Subclasses:   org.geotools.referencing.operation.builder.ExtendedPosition,
DirectPosition2D
public class DirectPosition2D extends Point2D.Double implements DirectPosition,Serializable(Code)
Holds the coordinates for a two-dimensional position within some coordinate reference system.

Note 1: This class inherits and fields. But despite their names, they don't need to be oriented toward and respectively. The (x,y) axis can have any orientation and should be understood as "ordinate 0" and "ordinate 1" values instead. This is not specific to this implementation; in Java2D too, the visual axis orientation depend on the .

The rational for avoiding axis orientation restriction is that other DirectPosition implementation do not have such restriction, and anyway it would be hard to generalize (what to do with direction?).

Note 2: Do not mix instances of this class with ordinary Point2D instances in a java.util.HashSet or as java.util.HashMap keys. It is not possible to meet both Point2D.hashCode and DirectPosition.hashCode contract, and this class choose to implements the later. Concequently, DirectPosition2D.hashCode is inconsistent with Point2D.equals (but is consistent with DirectPosition.equals ).

In other words, it is safe to add instances of DirectPosition2D in a HashSet , but it is unsafe to add them in a HashSet . Collections that do not rely on Object.hashCode , like java.util.ArrayList , are safe in all cases.
since:
   2.0
version:
   $Id: DirectPosition2D.java 28788 2008-01-16 18:18:22Z desruisseaux $
author:
   Martin Desruisseaux
See Also:   DirectPosition1D
See Also:   GeneralPosition
See Also:   java.awt.geom.Point2D




Constructor Summary
public  DirectPosition2D()
     Constructs a position initialized to (0,0) with a null coordinate reference system.
public  DirectPosition2D(CoordinateReferenceSystem crs)
     Constructs a position with the specified coordinate reference system.
public  DirectPosition2D(double x, double y)
     Constructs a 2D position from the specified ordinates.
public  DirectPosition2D(CoordinateReferenceSystem crs, double x, double y)
     Constructs a 2D position from the specified ordinates in the specified CRS.
public  DirectPosition2D(Point2D point)
     Constructs a position from the specified Point2D .
public  DirectPosition2D(DirectPosition point)
     Constructs a position initialized to the same values than the specified point.

Method Summary
public  booleanequals(Object object)
     Compares this point with the specified object for equality.
final public  CoordinateReferenceSystemgetCoordinateReferenceSystem()
     Returns the coordinate reference system in which the coordinate is given.
public  double[]getCoordinates()
     Returns a sequence of numbers that hold the coordinate of this position in its reference system.
final public  intgetDimension()
     The length of coordinate sequence (the number of entries).
final public  doublegetOrdinate(int dimension)
     Returns the ordinate at the specified dimension.
Parameters:
  dimension - The dimension in the range 0 to 1 inclusive.
public  DirectPositiongetPosition()
     Returns always this, the direct position for this .
public  inthashCode()
     Returns a hash value for this coordinate.
public  voidsetCoordinateReferenceSystem(CoordinateReferenceSystem crs)
     Set the coordinate reference system in which the coordinate is given.
public  voidsetLocation(DirectPosition position)
     Set this coordinate to the specified direct position.
final public  voidsetOrdinate(int dimension, double value)
     Sets the ordinate value along the specified dimension.
public  Point2DtoPoint2D()
     Returns a Point2D with the same coordinate as this direct position.
public  StringtoString()
     Returns a string representation of this coordinate.


Constructor Detail
DirectPosition2D
public DirectPosition2D()(Code)
Constructs a position initialized to (0,0) with a null coordinate reference system.



DirectPosition2D
public DirectPosition2D(CoordinateReferenceSystem crs)(Code)
Constructs a position with the specified coordinate reference system.



DirectPosition2D
public DirectPosition2D(double x, double y)(Code)
Constructs a 2D position from the specified ordinates. Despite their name, the (x,y) coordinates don't need to be oriented toward ( , ). Those parameter names simply match the and fields. See the for details.



DirectPosition2D
public DirectPosition2D(CoordinateReferenceSystem crs, double x, double y)(Code)
Constructs a 2D position from the specified ordinates in the specified CRS. Despite their name, the (x,y) coordinates don't need to be oriented toward ( , ). Those parameter names simply match the and fields. The actual axis orientations are determined by the specified CRS. See the for details.



DirectPosition2D
public DirectPosition2D(Point2D point)(Code)
Constructs a position from the specified Point2D .



DirectPosition2D
public DirectPosition2D(DirectPosition point)(Code)
Constructs a position initialized to the same values than the specified point.




Method Detail
equals
public boolean equals(Object object)(Code)
Compares this point with the specified object for equality. If the given object implements the DirectPosition interface, then the comparaison is performed as specified in its DirectPosition.equals contract. Otherwise the comparaison is performed as specified in Point2D.equals .



getCoordinateReferenceSystem
final public CoordinateReferenceSystem getCoordinateReferenceSystem()(Code)
Returns the coordinate reference system in which the coordinate is given. May be null if this particular DirectPosition is included in a larger object with such a reference to a . The coordinate reference system, or null .



getCoordinates
public double[] getCoordinates()(Code)
Returns a sequence of numbers that hold the coordinate of this position in its reference system. The coordinates



getDimension
final public int getDimension()(Code)
The length of coordinate sequence (the number of entries). This is always 2 for DirectPosition2D objects. The dimensionality of this position.



getOrdinate
final public double getOrdinate(int dimension) throws IndexOutOfBoundsException(Code)
Returns the ordinate at the specified dimension.
Parameters:
  dimension - The dimension in the range 0 to 1 inclusive. The coordinate at the specified dimension.
throws:
  IndexOutOfBoundsException - if the specified dimension is out of bounds.



getPosition
public DirectPosition getPosition()(Code)
Returns always this, the direct position for this .



hashCode
public int hashCode()(Code)
Returns a hash value for this coordinate. This method implements the DirectPosition.hashCode contract, not the Point2D.hashCode contract.



setCoordinateReferenceSystem
public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs)(Code)
Set the coordinate reference system in which the coordinate is given.
Parameters:
  crs - The new coordinate reference system, or null .



setLocation
public void setLocation(DirectPosition position) throws MismatchedDimensionException(Code)
Set this coordinate to the specified direct position. If the specified position contains a , then the CRS for this position will be set to the CRS of the specified position.
Parameters:
  position - The new position for this point.
throws:
  MismatchedDimensionException - if this point doesn't have the expected dimension.



setOrdinate
final public void setOrdinate(int dimension, double value) throws IndexOutOfBoundsException(Code)
Sets the ordinate value along the specified dimension.
Parameters:
  dimension - the dimension for the ordinate of interest.
Parameters:
  value - the ordinate value of interest.
throws:
  IndexOutOfBoundsException - if the specified dimension is out of bounds.



toPoint2D
public Point2D toPoint2D()(Code)
Returns a Point2D with the same coordinate as this direct position.



toString
public String toString()(Code)
Returns a string representation of this coordinate. The default implementation formats this coordinate using a shared instance of org.geotools.measure.CoordinateFormat . This is okay for occasional formatting (for example for debugging purpose). But if there is a lot of positions to format, users will get better performance and more control by using their own instance of org.geotools.measure.CoordinateFormat .



Methods inherited from java.awt.geom.Point2D
public Object clone()(Code)(Java Doc)
public static double distance(double x1, double y1, double x2, double y2)(Code)(Java Doc)
public double distance(double px, double py)(Code)(Java Doc)
public double distance(Point2D pt)(Code)(Java Doc)
public static double distanceSq(double x1, double y1, double x2, double y2)(Code)(Java Doc)
public double distanceSq(double px, double py)(Code)(Java Doc)
public double distanceSq(Point2D pt)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
abstract public double getX()(Code)(Java Doc)
abstract public double getY()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
abstract public void setLocation(double x, double y)(Code)(Java Doc)
public void setLocation(Point2D p)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.