org.deegree.geometry.standard.composite
Class DefaultCompositeCurve

java.lang.Object
  extended by org.deegree.geometry.standard.AbstractDefaultGeometry
      extended by org.deegree.geometry.standard.composite.DefaultCompositeCurve
All Implemented Interfaces:
Iterable<Curve>, Collection<Curve>, List<Curve>, GMLObject, Object, TypedObjectNode, CompositeCurve, Geometry, Curve, GeometricPrimitive

public class DefaultCompositeCurve
extends AbstractDefaultGeometry
implements CompositeCurve

Default implementation of CompositeCurve.

Version:
$Revision: 31641 $, $Date: 2011-08-24 21:24:55 +0200 (Wed, 24 Aug 2011) $
Author:
Markus Schneider , last edited by: $Author: mschneider $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.Curve
Curve.CurveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.primitive.GeometricPrimitive
GeometricPrimitive.PrimitiveType
 
Nested classes/interfaces inherited from interface org.deegree.geometry.Geometry
Geometry.GeometryType
 
Field Summary
 
Fields inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
crs, env, id, jtsFactory, jtsGeometry, pm
 
Constructor Summary
DefaultCompositeCurve(String id, ICRS crs, PrecisionModel pm, List<Curve> memberCurves)
          Creates a new DefaultCompositeCurve from the given parameters.
 
Method Summary
 boolean add(Curve e)
           
 void add(int index, Curve element)
           
 boolean addAll(Collection<? extends Curve> c)
           
 boolean addAll(int index, Collection<? extends Curve> c)
           
protected  com.vividsolutions.jts.geom.MultiLineString buildJTSGeometry()
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Curve get(int index)
           
 LineString getAsLineString()
          Returns a linear interpolated representation of the curve.
 Pair<Point,Point> getBoundary()
          The boundary of a curve is the set of points at either end of the curve.
 Points getControlPoints()
          Convenience method for accessing the control points of linear interpolated curves.
 int getCoordinateDimension()
          Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
 List<CurveSegment> getCurveSegments()
          Returns the segments that constitute this curve.
 Curve.CurveType getCurveType()
          Must always return Curve.CurveType#CompositeCurve.
 Point getEndPoint()
          Returns the end point of the curve.
 Geometry.GeometryType getGeometryType()
          Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.
 Measure getLength(Unit requestedUnit)
           
 GeometricPrimitive.PrimitiveType getPrimitiveType()
          Must always return GeometricPrimitive.PrimitiveType.Curve.
 Point getStartPoint()
          Returns the start point of the curve.
 int indexOf(Object o)
           
 boolean isClosed()
          Returns whether the curve forms a closed loop.
 boolean isEmpty()
           
 Iterator<Curve> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<Curve> listIterator()
           
 ListIterator<Curve> listIterator(int index)
           
 Curve remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 Curve set(int index, Curve element)
           
 int size()
           
 List<Curve> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class org.deegree.geometry.standard.AbstractDefaultGeometry
contains, createFromJTS, crosses, equals, getAsDefaultGeometry, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getEnvelope, getGMLProperties, getId, getIntersection, getJTSGeometry, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isSFSCompliant, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, toString, touches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.geometry.Geometry
contains, crosses, equals, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getDifference, getDistance, getEnvelope, getId, getIntersection, getPrecision, getUnion, intersects, isBeyond, isDisjoint, isSFSCompliant, isWithin, isWithinDistance, overlaps, setCoordinateSystem, setGMLProperties, setId, setPrecision, touches
 
Methods inherited from interface org.deegree.commons.tom.gml.GMLObject
getGMLProperties
 
Methods inherited from interface java.util.List
equals, hashCode
 

Constructor Detail

DefaultCompositeCurve

public DefaultCompositeCurve(String id,
                             ICRS crs,
                             PrecisionModel pm,
                             List<Curve> memberCurves)
Creates a new DefaultCompositeCurve from the given parameters.

Parameters:
id - identifier, may be null
crs - coordinate reference system, may be null
pm - precision model, may be null
memberCurves - curves that constitute the composited curve, each curve must end at the start point of the subsequent curve in the list
Method Detail

getGeometryType

public Geometry.GeometryType getGeometryType()
Description copied from interface: GeometricPrimitive
Must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY.

Specified by:
getGeometryType in interface Geometry
Specified by:
getGeometryType in interface GeometricPrimitive
Returns:
must always return Geometry.GeometryType#PRIMITIVE_GEOMETRY

getPrimitiveType

public GeometricPrimitive.PrimitiveType getPrimitiveType()
Description copied from interface: Curve
Must always return GeometricPrimitive.PrimitiveType.Curve.

Specified by:
getPrimitiveType in interface Curve
Specified by:
getPrimitiveType in interface GeometricPrimitive
Returns:
GeometricPrimitive.PrimitiveType.Curve

getCurveType

public Curve.CurveType getCurveType()
Description copied from interface: CompositeCurve
Must always return Curve.CurveType#CompositeCurve.

Specified by:
getCurveType in interface CompositeCurve
Specified by:
getCurveType in interface Curve
Returns:
Curve.CurveType#CompositeCurve

getBoundary

public Pair<Point,Point> getBoundary()
Description copied from interface: Curve
The boundary of a curve is the set of points at either end of the curve. If the curve is a cycle, the two ends are identical, and the curve (if topologically closed) is considered to not have a boundary.

Specified by:
getBoundary in interface Curve
Returns:
boundary of a curve. If a curve does not have a boundary because it is closed an empty List shall be retruned

getCurveSegments

public List<CurveSegment> getCurveSegments()
Description copied from interface: Curve
Returns the segments that constitute this curve.

Specified by:
getCurveSegments in interface Curve
Returns:
the segments that constitute this curve

getStartPoint

public Point getStartPoint()
Description copied from interface: Curve
Returns the start point of the curve.

Specified by:
getStartPoint in interface Curve
Returns:
the start point of the curve

getEndPoint

public Point getEndPoint()
Description copied from interface: Curve
Returns the end point of the curve.

Specified by:
getEndPoint in interface Curve
Returns:
the end point of the curve

getLength

public Measure getLength(Unit requestedUnit)
Specified by:
getLength in interface Curve
Returns:
length of the curve

isClosed

public boolean isClosed()
Description copied from interface: Curve
Returns whether the curve forms a closed loop.

Specified by:
isClosed in interface Curve
Returns:
true, if the curve forms a closed loop, false otherwise

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.

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

buildJTSGeometry

protected com.vividsolutions.jts.geom.MultiLineString buildJTSGeometry()
Overrides:
buildJTSGeometry in class AbstractDefaultGeometry

add

public boolean add(Curve e)
Specified by:
add in interface Collection<Curve>
Specified by:
add in interface List<Curve>

add

public void add(int index,
                Curve element)
Specified by:
add in interface List<Curve>

addAll

public boolean addAll(Collection<? extends Curve> c)
Specified by:
addAll in interface Collection<Curve>
Specified by:
addAll in interface List<Curve>

addAll

public boolean addAll(int index,
                      Collection<? extends Curve> c)
Specified by:
addAll in interface List<Curve>

clear

public void clear()
Specified by:
clear in interface Collection<Curve>
Specified by:
clear in interface List<Curve>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Curve>
Specified by:
contains in interface List<Curve>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Curve>
Specified by:
containsAll in interface List<Curve>

get

public Curve get(int index)
Specified by:
get in interface List<Curve>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<Curve>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Curve>
Specified by:
isEmpty in interface List<Curve>

iterator

public Iterator<Curve> iterator()
Specified by:
iterator in interface Iterable<Curve>
Specified by:
iterator in interface Collection<Curve>
Specified by:
iterator in interface List<Curve>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<Curve>

listIterator

public ListIterator<Curve> listIterator()
Specified by:
listIterator in interface List<Curve>

listIterator

public ListIterator<Curve> listIterator(int index)
Specified by:
listIterator in interface List<Curve>

remove

public Curve remove(int index)
Specified by:
remove in interface List<Curve>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Curve>
Specified by:
remove in interface List<Curve>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Curve>
Specified by:
removeAll in interface List<Curve>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Curve>
Specified by:
retainAll in interface List<Curve>

set

public Curve set(int index,
                 Curve element)
Specified by:
set in interface List<Curve>

size

public int size()
Specified by:
size in interface Collection<Curve>
Specified by:
size in interface List<Curve>

subList

public List<Curve> subList(int fromIndex,
                           int toIndex)
Specified by:
subList in interface List<Curve>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Curve>
Specified by:
toArray in interface List<Curve>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<Curve>
Specified by:
toArray in interface List<Curve>

getAsLineString

public LineString getAsLineString()
Description copied from interface: Curve
Returns a linear interpolated representation of the curve.

NOTE: This method is only safe to use when the curve is a LineString or LinearRing or it only consists of LineStringSegments. In any other case it will fail.

Specified by:
getAsLineString in interface Curve
Returns:
curve as a linestring

getControlPoints

public Points getControlPoints()
Description copied from interface: Curve
Convenience method for accessing the control points of linear interpolated curves.

NOTE: This method is only safe to use when the curve is a LineString or LinearRing or it only consists of LineStringSegments. In any other case it will fail.

Specified by:
getControlPoints in interface Curve
Returns:
the control points


Copyright © 2011. All Rights Reserved.