|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractDirectPosition
public abstract class AbstractDirectPosition
Base class for direct position implementations. This base class
provides default implementations for toString(), equals(java.lang.Object) and hashCode()
methods.
This class do not holds any state. The decision to implement Serializable
or Cloneable interfaces is left to implementors.
| referencing/geotk-referencing (download) | View source code for this class |
| Constructor Summary | |
|---|---|
protected |
AbstractDirectPosition()
Constructs a direct position. |
| Method Summary | |
|---|---|
boolean |
equals(Object object)
Returns true if the specified object is also a direct position with equals coordinate and
CRS. |
double[] |
getCoordinate()
Returns a sequence of numbers that hold the coordinate of this position in its reference system. |
DirectPosition |
getDirectPosition()
Returns always this, the direct position for this
position. |
int |
hashCode()
Returns a hash value for this coordinate. |
void |
setLocation(DirectPosition position)
Sets this direct position to the given position. |
String |
toString()
Formats this position in the Well Known Text (WKT) format. |
static String |
toString(DirectPosition position)
Formats a POINT element from a direct position. |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface DirectPosition |
|---|
getCoordinateReferenceSystem, getDimension, getOrdinate, setOrdinate |
| Constructor Detail |
|---|
protected AbstractDirectPosition()
| Method Detail |
|---|
public DirectPosition getDirectPosition()
this, the direct position for this
position.
getDirectPosition in interface Position
public void setLocation(DirectPosition position)
throws MismatchedDimensionException
null, then all ordinate values are set to NaN.
If this position and the given position have a non-null CRS, then the default implementation
requires the CRS to be equals (ignoring metadata)
otherwise a MismatchedReferenceSystemException is thrown. However subclass may
choose to assign the CRS of this position to the CRS of the given position.
position - The new position, or null.
MismatchedDimensionException - If the given position doesn't have the expected dimension.
MismatchedReferenceSystemException - If the given position doesn't use the expected CRS.public double[] getCoordinate()
getCoordinate in interface DirectPositionpublic String toString()
The output of this method can be parsed by thePOINT(ordinates)
GeneralDirectPosition constructor.
toString in class Objectpublic static String toString(DirectPosition position)
POINT element from a direct position. This method formats the given
position in the Well Known Text (WKT) format. The output is like below:
The output of this method can be parsed by thePOINT(ordinates)
GeneralDirectPosition constructor.
position - The position to format.
POINT in WKT format.GeneralDirectPosition.GeneralDirectPosition(String),
CoordinateFormat,
org.geotoolkit.io.wktpublic int hashCode()
hashCode in interface DirectPositionhashCode in class Objectpublic boolean equals(Object object)
true if the specified object is also a direct position with equals coordinate and
CRS.
equals in interface DirectPositionequals in class Objectobject - The object to compare with this position.
true if the given object is equal to this position.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||