org.deegree_impl.model.geometry
Class GM_LineString_Impl

java.lang.Object
  extended byorg.deegree_impl.model.geometry.GM_CurveSegment_Impl
      extended byorg.deegree_impl.model.geometry.GM_LineString_Impl
All Implemented Interfaces:
GM_CurveSegment, GM_GenericCurve, GM_LineString, java.io.Serializable

class GM_LineString_Impl
extends GM_CurveSegment_Impl
implements GM_LineString, java.io.Serializable

default implementation of the GM_LineString interface of package jago.model. ------------------------------------------------------------

Version:
10.6.2001
Author:
Andreas Poth

Field Summary
protected  CS_CoordinateSystem crs
           
protected  GM_Position[] points
           
private static long serialVersionUID
          Use serialVersionUID for interoperability.
 
Constructor Summary
GM_LineString_Impl(GM_Position[] gmps, CS_CoordinateSystem cs)
          Creates a new GM_LineString_Impl object.
 
Method Summary
 java.lang.Object clone()
          returns a shallow copy of the geometry
 boolean contains(GM_Object gmo)
          The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.
 boolean equals(java.lang.Object other)
          checks if this curve segment is completly equal to the submitted geometry
 GM_LineString getAsLineString()
          returns a reference to itself
 CS_CoordinateSystem getCoordinateSystem()
          returns the coordinate system of the curve segment
 GM_Point getEndPoint()
          returns the last point of the curve. if the curve segment doesn't contain a point null will be returned
 double getLength()
          returns the length of the curve in units of the related spatial reference system
 int getNumberOfPoints()
          returns the number of points building the curve or curve segment
 GM_Position getPositionAt(int index)
          returns the curve segment position at the submitted index
 GM_Position[] getPositions()
          returns all positions of the segement as array of GM_Position.
 GM_Point getStartPoint()
          returns the first point of the curve. if the curve segment doesn't contain a point null will be returned
 boolean intersects(GM_Object gmo)
          The Boolean valued operation "intersects" shall return TRUE if this GM_Object intersects another GM_Object.
private  boolean intersectsMultiPrimitive(GM_MultiPrimitive mprim)
          the operations returns true if the submitted multi primitive intersects with the curve segment
 void reverse()
          reverses the direction of the curvesegment
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.geometry.GM_CurveSegment
getCoordinateSystem, getNumberOfPoints, getPositionAt, getPositions, reverse
 
Methods inherited from interface org.deegree.model.geometry.GM_GenericCurve
getEndPoint, getStartPoint
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Use serialVersionUID for interoperability.

See Also:
Constant Field Values

crs

protected CS_CoordinateSystem crs

points

protected GM_Position[] points
Constructor Detail

GM_LineString_Impl

public GM_LineString_Impl(GM_Position[] gmps,
                          CS_CoordinateSystem cs)
                   throws GM_Exception
Creates a new GM_LineString_Impl object.

Parameters:
gmps -
cs -
Throws:
GM_Exception
Method Detail

clone

public java.lang.Object clone()
returns a shallow copy of the geometry


getLength

public double getLength()
returns the length of the curve in units of the related spatial reference system

Specified by:
getLength in interface GM_GenericCurve

getAsLineString

public GM_LineString getAsLineString()
                              throws GM_Exception
returns a reference to itself

Specified by:
getAsLineString in interface GM_GenericCurve
Throws:
GM_Exception

intersects

public boolean intersects(GM_Object gmo)
The Boolean valued operation "intersects" shall return TRUE if this GM_Object intersects another GM_Object. Within a GM_Complex, the GM_Primitives do not intersect one another. In general, topologically structured data uses shared geometric objects to capture intersection information.

Specified by:
intersects in interface GM_CurveSegment

intersectsMultiPrimitive

private boolean intersectsMultiPrimitive(GM_MultiPrimitive mprim)
                                  throws java.lang.Exception
the operations returns true if the submitted multi primitive intersects with the curve segment

Throws:
java.lang.Exception

contains

public boolean contains(GM_Object gmo)
The Boolean valued operation "contains" shall return TRUE if this GM_Object contains another GM_Object.

Specified by:
contains in interface GM_CurveSegment
Overrides:
contains in class GM_CurveSegment_Impl

getStartPoint

public GM_Point getStartPoint()
returns the first point of the curve. if the curve segment doesn't contain a point null will be returned

Specified by:
getStartPoint in interface GM_GenericCurve

getEndPoint

public GM_Point getEndPoint()
returns the last point of the curve. if the curve segment doesn't contain a point null will be returned

Specified by:
getEndPoint in interface GM_GenericCurve

getNumberOfPoints

public int getNumberOfPoints()
returns the number of points building the curve or curve segment

Specified by:
getNumberOfPoints in interface GM_CurveSegment

getPositions

public GM_Position[] getPositions()
returns all positions of the segement as array of GM_Position. If the segment is empty null will be returned

Specified by:
getPositions in interface GM_CurveSegment

getPositionAt

public GM_Position getPositionAt(int index)
returns the curve segment position at the submitted index

Specified by:
getPositionAt in interface GM_CurveSegment

reverse

public void reverse()
reverses the direction of the curvesegment

Specified by:
reverse in interface GM_CurveSegment

getCoordinateSystem

public CS_CoordinateSystem getCoordinateSystem()
returns the coordinate system of the curve segment

Specified by:
getCoordinateSystem in interface GM_CurveSegment

equals

public boolean equals(java.lang.Object other)
checks if this curve segment is completly equal to the submitted geometry

Parameters:
other - object to compare to

toString

public java.lang.String toString()
Returns: