org.geotools.geometry.iso.coordinate
Class PositionImpl

java.lang.Object
  extended by org.geotools.geometry.iso.coordinate.PositionImpl
All Implemented Interfaces:
java.io.Serializable, org.opengis.geometry.coordinate.Position

public class PositionImpl
extends java.lang.Object
implements org.opengis.geometry.coordinate.Position, java.io.Serializable

Author:
Jackson Roehrig & Sanjay Jena The data type Position is a union type consisting of either a DirectPosition2D or of a reference to a Point from which a DirectPosition2D is obtained. The use of this data type allows the identification of a position either directly as a coordinate (variant direct) or indirectly as a reference to a Point (variant indirect). Position::direct [0,1] : DirectPosition2D Position::indirect [0,1] : PointRef Position: {direct.isNull = indirect.isNotNull}
See Also:
Serialized Form

Constructor Summary
PositionImpl(org.opengis.geometry.DirectPosition directPosition)
          Creates a new Position instance.
PositionImpl(PointImpl pointRef)
          Creates a new Position instance.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getCoordinateDimension()
          Returns the coordinate dimension of the position
 org.opengis.geometry.DirectPosition getDirectPosition()
           
 PointImpl getPoint()
          Returns a Point or null
 org.opengis.geometry.DirectPosition getPosition()
          Deprecated. 
 int hashCode()
           
 boolean hasPoint()
          Returns true, if the Position is representated as a PointReference.
 void setDirectPosition(DirectPositionImpl position)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PositionImpl

public PositionImpl(org.opengis.geometry.DirectPosition directPosition)
Creates a new Position instance.

Parameters:
directPosition - an DirectPosition2D value

PositionImpl

public PositionImpl(PointImpl pointRef)
Creates a new Position instance.

Parameters:
pointRef - an PointRef value
Method Detail

getPosition

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

Specified by:
getPosition in interface org.opengis.geometry.coordinate.Position

getDirectPosition

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

hasPoint

public boolean hasPoint()
Returns true, if the Position is representated as a PointReference. Returns false, if the Position is representated as a DirectPoint.

Returns:
true if the Position is representated as a PointReference

getPoint

public PointImpl getPoint()
Returns a Point or null

Returns:
the Point if the position is of type Point. If position is an instance of DirectPositionImpl, return a new Point if force is true and null is force is false

setDirectPosition

public void setDirectPosition(DirectPositionImpl position)
Parameters:
position - The position to set.

getCoordinateDimension

public int getCoordinateDimension()
Returns the coordinate dimension of the position

Returns:
dimension

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.