deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.spatialschema
Class RingImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryImpl
      extended by org.deegree.model.spatialschema.PrimitiveImpl
          extended by org.deegree.model.spatialschema.OrientablePrimitiveImpl
              extended by org.deegree.model.spatialschema.OrientableCurveImpl
                  extended by org.deegree.model.spatialschema.RingImpl
All Implemented Interfaces:
Serializable, Geometry, OrientableCurve, OrientablePrimitive, Primitive, Ring

public class RingImpl
extends OrientableCurveImpl
implements Ring, Serializable

default implementation of the Ring interface of the

Since:
2.0
Version:
$Revision: 18195 $, 1.0. $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Andreas Poth, last edited by: $Author: mschneider $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
orientation
 
Fields inherited from class org.deegree.model.spatialschema.GeometryImpl
boundary, centroid, convexHull, crs, empty, envelope, mute, valid
 
Fields inherited from interface org.deegree.model.spatialschema.Geometry
BUFFER_CAP_BUTT, BUFFER_CAP_ROUND, BUFFER_CAP_SQUARE
 
Constructor Summary
protected RingImpl(CurveSegment[] segments, CoordinateSystem crs, char orientation)
          Constructor, with curve segments, CoordinateSystem and Orientation
protected RingImpl(Position[] points, CoordinateSystem crs)
          Constructor, with an array and CoordinateSystem
protected RingImpl(Position[] points, CoordinateSystem crs, char orientation)
          Constructor, with an array, CoordinateSystem and Orientation
 
Method Summary
protected  void calculateCentroid()
          calculates the centroid of the ring
protected  void calculateParam()
          recalculates internal parameters
 Object clone()
           
 boolean contains(Geometry gmo)
          The Boolean valued operation "contains" shall return TRUE if this Geometry contains another Geometry.
 boolean contains(Position position)
          The Boolean valued operation "contains" shall return TRUE if this Geometry contains a single point given by a coordinate.
 boolean equals(Object other)
          Compares the Geometry to be equal to another Geometry.
 CurveSegment getAsCurveSegment()
          returns the Ring as one CurveSegment
 int getCoordinateDimension()
          The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.
 CurveBoundary getCurveBoundary()
          returns the CurveBoundary of the Ring.
 CurveSegment[] getCurveSegments()
          returns the Ring as a CurveSegments
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 Position[] getPositions()
          gets the Ring as a Array of positions.
 boolean intersects(Geometry gmo)
          The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry.
 boolean isCycle()
          Ring must be closed, so isCycle returns TRUE.
 boolean isSimple()
          Ring is a PrimitiveBoundary, so isSimple returns TRUE.
protected  void setPositions(Position[][] positions)
          sets the Ring as a ArrayList of points
 String toString()
           
 
Methods inherited from class org.deegree.model.spatialschema.OrientablePrimitiveImpl
getOrientation, setOrientation
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isEmpty, isValid, isWithinDistance, setCoordinateSystem, setEmpty, setTolerance, setValid, translate, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.spatialschema.OrientablePrimitive
getOrientation, setOrientation
 
Methods inherited from interface org.deegree.model.spatialschema.Geometry
difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isEmpty, isWithinDistance, setTolerance, translate, union
 

Constructor Detail

RingImpl

protected RingImpl(Position[] points,
                   CoordinateSystem crs)
            throws GeometryException
Constructor, with an array and CoordinateSystem

Parameters:
points -
crs -
Throws:
GeometryException

RingImpl

protected RingImpl(Position[] points,
                   CoordinateSystem crs,
                   char orientation)
            throws GeometryException
Constructor, with an array, CoordinateSystem and Orientation

Parameters:
points -
crs -
orientation -
Throws:
GeometryException

RingImpl

protected RingImpl(CurveSegment[] segments,
                   CoordinateSystem crs,
                   char orientation)
            throws GeometryException
Constructor, with curve segments, CoordinateSystem and Orientation

Parameters:
segments -
crs -
orientation -
Throws:
GeometryException
Method Detail

isCycle

public boolean isCycle()
Ring must be closed, so isCycle returns TRUE.

Specified by:
isCycle in interface Ring
Returns:
true because a ring is always a cycle

isSimple

public boolean isSimple()
Ring is a PrimitiveBoundary, so isSimple returns TRUE.

Specified by:
isSimple in interface Ring
Returns:
true because a ring is always a simple

getDimension

public int getDimension()
The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension. The dimension of a collection of geometric objects shall be the largest dimension of any of its pieces. Points are 0-dimensional, curves are 1-dimensional, surfaces are 2-dimensional, and solids are 3-dimensional.

Specified by:
getDimension in interface Geometry
Returns:
the for this geometry defined dimension.

getCoordinateDimension

public int getCoordinateDimension()
The operation "coordinateDimension" shall return the dimension of the coordinates that define this Geometry, which must be the same as the coordinate dimension of the coordinate reference system for this Geometry.

Specified by:
getCoordinateDimension in interface Geometry
Returns:
the actual dimension

getPositions

public Position[] getPositions()
gets the Ring as a Array of positions.

Specified by:
getPositions in interface Ring
Returns:
all positions the builds the ring

setPositions

protected void setPositions(Position[][] positions)
                     throws GeometryException
sets the Ring as a ArrayList of points

Parameters:
positions -
Throws:
GeometryException

getAsCurveSegment

public CurveSegment getAsCurveSegment()
                               throws GeometryException
returns the Ring as one CurveSegment

Specified by:
getAsCurveSegment in interface Ring
Returns:
the ring as an instance of CurveSegment
Throws:
GeometryException

getCurveSegments

public CurveSegment[] getCurveSegments()
returns the Ring as a CurveSegments

Specified by:
getCurveSegments in interface Ring
Returns:
curve segments

getCurveBoundary

public CurveBoundary getCurveBoundary()
returns the CurveBoundary of the Ring. For a CurveBoundary is defines as the first and the last point of a Curve the CurveBoundary of a Ring contains two indentical point (because a Ring is closed)

Specified by:
getCurveBoundary in interface OrientableCurve
Returns:
the curve boundary of an orientable curve.

equals

public boolean equals(Object other)
Description copied from class: GeometryImpl
Compares the Geometry to be equal to another Geometry.

Overrides:
equals in class GeometryImpl
Parameters:
other - the Geometry to test for equality
Returns:
true if the objects are equal, else false

clone

public Object clone()
Overrides:
clone in class GeometryImpl

intersects

public boolean intersects(Geometry gmo)
Description copied from class: GeometryImpl
The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry. Within a Complex, the Primitives do not intersect one another. In general, topologically structured data uses shared geometric objects to capture intersection information.

Specified by:
intersects in interface Geometry
Overrides:
intersects in class GeometryImpl
Parameters:
gmo - the Geometry to intersect with
Returns:
true if the objects intersects, else false

contains

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

At the moment the operation just works with point geometries

Specified by:
contains in interface Geometry
Overrides:
contains in class GeometryImpl
Parameters:
gmo - the Geometry to test (whether is is contained)
Returns:
true if the given object is contained, else false

contains

public boolean contains(Position position)
Description copied from class: GeometryImpl
The Boolean valued operation "contains" shall return TRUE if this Geometry contains a single point given by a coordinate.

Specified by:
contains in interface Geometry
Overrides:
contains in class GeometryImpl
Parameters:
position - Position to test (whether is is contained)
Returns:
true if the given object is contained, else false

calculateCentroid

protected void calculateCentroid()
calculates the centroid of the ring


calculateParam

protected void calculateParam()
Description copied from class: GeometryImpl
recalculates internal parameters

Specified by:
calculateParam in class GeometryImpl

toString

public String toString()
Overrides:
toString in class GeometryImpl

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org