Java Doc for GeneralDirectPosition.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
   org.geotools.geometry.AbstractDirectPosition
      org.geotools.geometry.GeneralDirectPosition

All known Subclasses:   org.geotools.geometry.TransformedDirectPosition,
GeneralDirectPosition
public class GeneralDirectPosition extends AbstractDirectPosition implements Serializable,Cloneable(Code)
Holds the coordinates for a position within some coordinate reference system. Since DirectPosition s, as data types, will often be included in larger objects (such as ) that have references to CoordinateReferenceSystem , the GeneralDirectPosition.getCoordinateReferenceSystem method may returns null if this particular DirectPosition is included in a larger object with such a reference to a . In this case, the cordinate reference system is implicitly assumed to take on the value of the containing object's CoordinateReferenceSystem .

This particular implementation of DirectPosition is said "General" because it uses an of an arbitrary length. If the direct position is know to be always two-dimensional, then DirectPosition2D may provides a more efficient implementation.

Most methods in this implementation are final for performance reason.
since:
   2.0
version:
   $Id: GeneralDirectPosition.java 26137 2007-07-03 17:59:44Z desruisseaux $
author:
   Martin Desruisseaux
See Also:   DirectPosition1D
See Also:   DirectPosition2D
See Also:   java.awt.geom.Point2D



Field Summary
final public  double[]ordinates
     The ordinates of the direct position.

Constructor Summary
public  GeneralDirectPosition(CoordinateReferenceSystem crs)
     Constructs a position using the specified coordinate reference system.
public  GeneralDirectPosition(int numDim)
     Constructs a position with the specified number of dimensions.
public  GeneralDirectPosition(double[] ordinates)
     Constructs a position with the specified ordinates.
public  GeneralDirectPosition(double x, double y)
     Constructs a 2D position from the specified ordinates.
public  GeneralDirectPosition(double x, double y, double z)
     Constructs a 3D position from the specified ordinates.
public  GeneralDirectPosition(Point2D point)
     Constructs a position from the specified Point2D .
public  GeneralDirectPosition(DirectPosition point)
     Constructs a position initialized to the same values than the specified point.

Method Summary
public  Objectclone()
     Returns a deep copy of this position.
final public  CoordinateReferenceSystemgetCoordinateReferenceSystem()
     Returns the coordinate reference system in which the coordinate is given.
final 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.
public  inthashCode()
     Returns a hash value for this coordinate.
static  inthashCode(double[] ordinates)
     Returns a hash value for the specified ordinates.
public  voidsetCoordinateReferenceSystem(CoordinateReferenceSystem crs)
     Set the coordinate reference system in which the coordinate is given.
final public  voidsetLocation(DirectPosition position)
     Set this coordinate to the specified direct position.
final public  voidsetLocation(GeneralDirectPosition position)
     Set this coordinate to the specified direct position.
final public  voidsetLocation(Point2D point)
     Set this coordinate to the specified Point2D .
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 static  StringtoString(DirectPosition position)
     Formats the specified position.

Field Detail
ordinates
final public double[] ordinates(Code)
The ordinates of the direct position.




Constructor Detail
GeneralDirectPosition
public GeneralDirectPosition(CoordinateReferenceSystem crs)(Code)
Constructs a position using the specified coordinate reference system. The number of dimensions is inferred from the coordinate reference system.
since:
   2.2



GeneralDirectPosition
public GeneralDirectPosition(int numDim) throws NegativeArraySizeException(Code)
Constructs a position with the specified number of dimensions.
Parameters:
  numDim - Number of dimensions.
throws:
  NegativeArraySizeException - if numDim is negative.



GeneralDirectPosition
public GeneralDirectPosition(double[] ordinates)(Code)
Constructs a position with the specified ordinates. The ordinates array will be copied.



GeneralDirectPosition
public GeneralDirectPosition(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 ( , ). See the DirectPosition2D javadoc for details.



GeneralDirectPosition
public GeneralDirectPosition(double x, double y, double z)(Code)
Constructs a 3D position from the specified ordinates. Despite their name, the (x,y,z) coordinates don't need to be oriented toward ( , , ).



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



GeneralDirectPosition
public GeneralDirectPosition(DirectPosition point)(Code)
Constructs a position initialized to the same values than the specified point.
since:
   2.2




Method Detail
clone
public Object clone()(Code)
Returns a deep copy of this position.



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
final public double[] getCoordinates()(Code)
Returns a sequence of numbers that hold the coordinate of this position in its reference system. A copy of the .



getDimension
final public int getDimension()(Code)
The length of coordinate sequence (the number of entries). This may be less than or equal to the dimensionality of the . 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. The coordinate at the specified dimension.
throws:
  IndexOutOfBoundsException - if the specified dimension is out of bounds.



hashCode
public int hashCode()(Code)
Returns a hash value for this coordinate.



hashCode
static int hashCode(double[] ordinates)(Code)
Returns a hash value for the specified ordinates.



setCoordinateReferenceSystem
public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs) throws MismatchedDimensionException(Code)
Set the coordinate reference system in which the coordinate is given.
Parameters:
  crs - The new coordinate reference system, or null .
throws:
  MismatchedDimensionException - if the specified CRS doesn't have the expectednumber of dimensions.



setLocation
final 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.
since:
   2.2



setLocation
final public void setLocation(GeneralDirectPosition position) throws MismatchedDimensionException(Code)
Set this coordinate to the specified direct position. This method is identical to GeneralDirectPosition.setLocation(DirectPosition) , but is slightly faster in the special case of an GeneralDirectPosition implementation.
Parameters:
  position - The new position for this point.
throws:
  MismatchedDimensionException - if this point doesn't have the expected dimension.



setLocation
final public void setLocation(Point2D point) throws MismatchedDimensionException(Code)
Set this coordinate to the specified Point2D . This coordinate must be two-dimensional.
Parameters:
  point - The new coordinate for this point.
throws:
  MismatchedDimensionException - if this coordinate point is not two-dimensional.



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() throws IllegalStateException(Code)
Returns a Point2D with the same coordinate as this direct position. This is a convenience method for interoperability with Java2D.
throws:
  IllegalStateException - if this coordinate point is not two-dimensional.



toString
public static String toString(DirectPosition position)(Code)
Formats the specified position.
since:
   2.3org.geotools.measure.CoordinateFormat



Methods inherited from org.geotools.geometry.AbstractDirectPosition
static void checkCoordinateReferenceSystemDimension(CoordinateReferenceSystem crs, int expected) throws MismatchedDimensionException(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
static void ensureDimensionMatch(String name, int dimension, int expectedDimension) throws MismatchedDimensionException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
public double[] getCoordinates()(Code)(Java Doc)
public DirectPosition getPosition()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
static int hashCode(DirectPosition position)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
static String toString(DirectPosition position)(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.