JScience v4.3

org.jscience.geography.coordinates
Class Coordinates<R extends CoordinateReferenceSystem<?>>

java.lang.Object
  extended by org.jscience.geography.coordinates.Coordinates<R>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javolution.lang.Immutable, javolution.lang.Realtime, javolution.lang.ValueType, javolution.xml.XMLSerializable, org.opengis.spatialschema.geometry.DirectPosition, org.opengis.spatialschema.geometry.geometry.Position
Direct Known Subclasses:
Altitude, CompoundCoordinates, Height, LatLong, Time, UTM, XYZ

public abstract class Coordinates<R extends CoordinateReferenceSystem<?>>
extends java.lang.Object
implements org.opengis.spatialschema.geometry.DirectPosition, javolution.lang.Realtime, javolution.lang.ValueType, javolution.xml.XMLSerializable

This class designates the position that a point occupies in a given n-dimensional reference frame or system. This implementation is compatible with OpenGIS® DirectPosition.

Version:
4.0, April 9, 2007
Author:
Jean-Marie Dautelle
See Also:
Open Geospatial Consortium, Inc., Serialized Form

Constructor Summary
protected Coordinates()
          Default constructor.
 
Method Summary
 Coordinates<R> clone()
          OpenGIS® - Makes an exact copy of this coordinate.
abstract  Coordinates<?> copy()
          Returns a copy of these coordinates allocated by the calling thread (possibly on the stack).
abstract  R getCoordinateReferenceSystem()
          Returns the reference system for this coordinates.
 double[] getCoordinates()
          OpenGIS® - Returns the sequence of numbers that hold the coordinate of this position in its reference system.
abstract  int getDimension()
          OpenGIS® - The length of coordinate sequence (the number of entries).
abstract  double getOrdinate(int dimension)
          OpenGIS® - Returns the ordinate at the specified dimension.
 org.opengis.spatialschema.geometry.DirectPosition getPosition()
          OpenGIS® - Returns the direct position for this position.
 void setOrdinate(int dimension, double value)
          OpenGIS® - Throws UnsupportedOperationException as JScience coordinates are immutable.
 java.lang.String toString()
          Returns the text representation of these coordinates as a java.lang.String.
 javolution.text.Text toText()
          Returns the string representation of this coordinates.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Coordinates

protected Coordinates()
Default constructor.

Method Detail

getCoordinateReferenceSystem

public abstract R getCoordinateReferenceSystem()
Returns the reference system for this coordinates.

Specified by:
getCoordinateReferenceSystem in interface org.opengis.spatialschema.geometry.DirectPosition
Returns:
the associated coordinate reference system.

getDimension

public abstract int getDimension()
OpenGIS® - The length of coordinate sequence (the number of entries). This is determined by the coordinate reference system.

Specified by:
getDimension in interface org.opengis.spatialschema.geometry.DirectPosition
Returns:
the dimensionality of this position.

getOrdinate

public abstract double getOrdinate(int dimension)
                            throws java.lang.IndexOutOfBoundsException
OpenGIS® - Returns the ordinate at the specified dimension.

Specified by:
getOrdinate in interface org.opengis.spatialschema.geometry.DirectPosition
Parameters:
dimension - The dimension in the range 0 to dimension-1.
Returns:
The coordinate at the specified dimension.
Throws:
java.lang.IndexOutOfBoundsException - if the specified dimension is out of bounds.

setOrdinate

public final void setOrdinate(int dimension,
                              double value)
                       throws java.lang.IndexOutOfBoundsException
OpenGIS® - Throws UnsupportedOperationException as JScience coordinates are immutable.

Specified by:
setOrdinate in interface org.opengis.spatialschema.geometry.DirectPosition
Throws:
java.lang.IndexOutOfBoundsException

getCoordinates

public final double[] getCoordinates()
OpenGIS® - Returns the sequence of numbers that hold the coordinate of this position in its reference system.

Specified by:
getCoordinates in interface org.opengis.spatialschema.geometry.DirectPosition
Returns:
a copy of the coordinates. Changes in the returned array will not be reflected back in this DirectPosition object.

getPosition

public final org.opengis.spatialschema.geometry.DirectPosition getPosition()
OpenGIS® - Returns the direct position for this position.

Returns:
this

clone

public final Coordinates<R> clone()
OpenGIS® - Makes an exact copy of this coordinate.

Specified by:
clone in interface org.opengis.spatialschema.geometry.DirectPosition
Overrides:
clone in class java.lang.Object
Returns:
the copy.

toText

public javolution.text.Text toText()
Returns the string representation of this coordinates.

Specified by:
toText in interface javolution.lang.Realtime
Returns:
the coordinates values/units.

toString

public final java.lang.String toString()
Returns the text representation of these coordinates as a java.lang.String.

Overrides:
toString in class java.lang.Object
Returns:
toText().toString()

copy

public abstract Coordinates<?> copy()
Returns a copy of these coordinates allocated by the calling thread (possibly on the stack).

Specified by:
copy in interface javolution.lang.ValueType
Returns:
an identical and independant copy of these coordinates .

JScience v4.3

Copyright © 2006 JScience.