|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractDirectPosition
DirectPosition1D
public class DirectPosition1D
Holds the coordinates for a one-dimensional position within some coordinate reference system.
DirectPosition2D,
GeneralDirectPosition,
Serialized Form
| referencing/geotk-referencing (download) | View source code for this class |
| Field Summary | |
|---|---|
double |
ordinate
The ordinate value. |
| Constructor Summary | |
|---|---|
DirectPosition1D()
Constructs a position initialized to (0) with a null
coordinate reference system. |
|
DirectPosition1D(CoordinateReferenceSystem crs)
Constructs a position with the specified coordinate reference system. |
|
DirectPosition1D(DirectPosition point)
Constructs a position initialized to the same values than the specified point. |
|
DirectPosition1D(double ordinate)
Constructs a 1D position from the specified ordinate. |
|
DirectPosition1D(String wkt)
Constructs a position initialized to the values parsed from the given string in Well Known Text (WKT) format. |
|
| Method Summary | |
|---|---|
DirectPosition1D |
clone()
Returns a copy of this position. |
double[] |
getCoordinate()
Returns a sequence of numbers that hold the coordinate of this position in its reference system. |
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system in which the coordinate is given. |
int |
getDimension()
The length of coordinate sequence (the number of entries). |
double |
getOrdinate(int dimension)
Returns the ordinate at the specified dimension. |
int |
hashCode()
Returns a hash value for this coordinate. |
void |
setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
Sets the coordinate reference system in which the coordinate is given. |
void |
setLocation(DirectPosition position)
Sets this coordinate to the specified direct position. |
void |
setOrdinate(int dimension,
double value)
Sets the ordinate value along the specified dimension. |
| Methods inherited from class AbstractDirectPosition |
|---|
equals, getDirectPosition, toString, toString |
| Methods inherited from class Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public double ordinate
| Constructor Detail |
|---|
public DirectPosition1D()
null
coordinate reference system.
public DirectPosition1D(CoordinateReferenceSystem crs)
crs - The coordinate reference system.public DirectPosition1D(double ordinate)
ordinate - The ordinate value.public DirectPosition1D(DirectPosition point)
point - The position to copy.
public DirectPosition1D(String wkt)
throws NumberFormatException,
IllegalArgumentException
POINT
element like below:
POINT(6)
wkt - The POINT or other kind of element to parse.
NumberFormatException - If a number can not be parsed.
IllegalArgumentException - If the parenthesis are not balanced.
MismatchedDimensionException - If the given point is not one-dimensional.AbstractDirectPosition.toString(DirectPosition),
CoordinateFormat| Method Detail |
|---|
public final CoordinateReferenceSystem getCoordinateReferenceSystem()
null if this particular DirectPosition is included
in a larger object with such a reference to a CRS.
getCoordinateReferenceSystem in interface DirectPositionnull.public void setCoordinateReferenceSystem(CoordinateReferenceSystem crs)
crs - The new coordinate reference system, or null.public final int getDimension()
DirectPosition1D objects.
getDimension in interface DirectPositionpublic double[] getCoordinate()
getCoordinate in interface DirectPositiongetCoordinate in class AbstractDirectPosition
public final double getOrdinate(int dimension)
throws IndexOutOfBoundsException
getOrdinate in interface DirectPositiondimension - The dimension, which must be 0.
IndexOutOfBoundsException - if the specified dimension is out of bounds.
public final void setOrdinate(int dimension,
double value)
throws IndexOutOfBoundsException
setOrdinate in interface DirectPositiondimension - The dimension, which must be 0.value - the ordinate value.
IndexOutOfBoundsException - if the specified dimension is out of bounds.
public void setLocation(DirectPosition position)
throws MismatchedDimensionException
setLocation in class AbstractDirectPositionposition - The new position for this point.
MismatchedDimensionException - if this point doesn't have the expected dimension.public int hashCode()
hashCode in interface DirectPositionhashCode in class AbstractDirectPositionpublic DirectPosition1D clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||