org.geotools.geometry.jts.spatialschema.geometry
Class DirectPositionImpl

java.lang.Object
  extended by org.geotools.geometry.jts.spatialschema.geometry.DirectPositionImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.opengis.geometry.coordinate.Position, org.opengis.geometry.DirectPosition

public class DirectPositionImpl
extends java.lang.Object
implements org.opengis.util.Cloneable, org.opengis.geometry.DirectPosition, org.opengis.geometry.coordinate.Position, java.io.Serializable

Holds the coordinates for a position within some coordinate reference system. Since DirectPositions, as data types, will often be included in larger objects (such as geometries) that have references to CoordinateReferenceSystem, the getCoordinateReferenceSystem() method may returns null if this particular DirectPosition is included in a larger object with such a reference to a coordinate reference system. In this case, the cordinate reference system is implicitly assumed to take on the value of the containing object's CoordinateReferenceSystem.

Version:
$Revision: 1.9 $, $Date: 2005/11/02 05:39:33 $
Author:
ISO/DIS 19107, OpenGIS® consortium
See Also:
Serialized Form

Field Summary
 double[] ordinates
          Comment for ordinates.
 
Constructor Summary
DirectPositionImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a new DirectPositionImpl.
DirectPositionImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs, double[] ordinates)
          Creates a new DirectPositionImpl.
DirectPositionImpl(org.opengis.geometry.DirectPosition point)
          Construct a position initialized to the same values than the specified point.
DirectPositionImpl(DirectPositionImpl point)
          Construct a position initialized to the same values than the specified point.
DirectPositionImpl(double[] ordinates)
          Construct a position with the specified ordinates.
DirectPositionImpl(double x, double y)
          Construct a 2D position from the specified ordinates.
DirectPositionImpl(double x, double y, double z)
          Construct a 3D position from the specified ordinates.
DirectPositionImpl(int numDim)
          Construct a position with the specified number of dimensions.
DirectPositionImpl(java.awt.geom.Point2D point)
          Construct a position from the specified Point2D.
 
Method Summary
 DirectPositionImpl clone()
           
 boolean equals(java.lang.Object obj)
           
 double[] getCoordinate()
           
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 double[] getCoordinates()
          Deprecated. 
 int getDimension()
           
 org.opengis.geometry.DirectPosition getDirectPosition()
           
 double getOrdinate(int dimension)
           
 org.opengis.geometry.DirectPosition getPosition()
          Deprecated. 
 int hashCode()
           
 void setOrdinate(int dimension, double value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ordinates

public final double[] ordinates
Comment for ordinates.

Constructor Detail

DirectPositionImpl

public DirectPositionImpl(int numDim)
                   throws java.lang.NegativeArraySizeException
Construct a position with the specified number of dimensions.

Parameters:
numDim - Number of dimensions.
Throws:
java.lang.NegativeArraySizeException - if numDim is negative.

DirectPositionImpl

public DirectPositionImpl(double[] ordinates)
Construct a position with the specified ordinates. The ordinates array will be copied.


DirectPositionImpl

public DirectPositionImpl(double x,
                          double y)
Construct a 2D position from the specified ordinates.


DirectPositionImpl

public DirectPositionImpl(double x,
                          double y,
                          double z)
Construct a 3D position from the specified ordinates.


DirectPositionImpl

public DirectPositionImpl(java.awt.geom.Point2D point)
Construct a position from the specified Point2D.


DirectPositionImpl

public DirectPositionImpl(DirectPositionImpl point)
Construct a position initialized to the same values than the specified point.


DirectPositionImpl

public DirectPositionImpl(org.opengis.geometry.DirectPosition point)
Construct a position initialized to the same values than the specified point.


DirectPositionImpl

public DirectPositionImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a new DirectPositionImpl.

Parameters:
crs -

DirectPositionImpl

public DirectPositionImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                          double[] ordinates)
Creates a new DirectPositionImpl.

Parameters:
crs -
ordinates -
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDimension

public int getDimension()
Specified by:
getDimension in interface org.opengis.geometry.DirectPosition
See Also:
org.opengis.geometry.coordinate.DirectPosition#getDimension()

getCoordinate

public double[] getCoordinate()
Specified by:
getCoordinate in interface org.opengis.geometry.DirectPosition
See Also:
org.opengis.geometry.coordinate.DirectPosition#getCoordinates()

getCoordinates

@Deprecated
public double[] getCoordinates()
Deprecated. 

Specified by:
getCoordinates in interface org.opengis.geometry.DirectPosition

getOrdinate

public double getOrdinate(int dimension)
                   throws java.lang.IndexOutOfBoundsException
Specified by:
getOrdinate in interface org.opengis.geometry.DirectPosition
Throws:
java.lang.IndexOutOfBoundsException
See Also:
org.opengis.geometry.coordinate.DirectPosition#getOrdinate(int)

setOrdinate

public void setOrdinate(int dimension,
                        double value)
                 throws java.lang.IndexOutOfBoundsException
Specified by:
setOrdinate in interface org.opengis.geometry.DirectPosition
Throws:
java.lang.IndexOutOfBoundsException
See Also:
org.opengis.geometry.coordinate.DirectPosition#setOrdinate(int, double)

getCoordinateReferenceSystem

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Specified by:
getCoordinateReferenceSystem in interface org.opengis.geometry.DirectPosition
See Also:
org.opengis.geometry.coordinate.DirectPosition#getCoordinateReferenceSystem()

clone

public DirectPositionImpl clone()
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

getDirectPosition

public org.opengis.geometry.DirectPosition getDirectPosition()
Specified by:
getDirectPosition in interface org.opengis.geometry.coordinate.Position
See Also:
Position.getDirectPosition()

getPosition

@Deprecated
public org.opengis.geometry.DirectPosition getPosition()
Deprecated. 

Specified by:
getPosition in interface org.opengis.geometry.coordinate.Position
See Also:
Position.getPosition()

hashCode

public int hashCode()
Specified by:
hashCode in interface org.opengis.geometry.DirectPosition
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface org.opengis.geometry.DirectPosition
Overrides:
equals in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.