deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.model.spatialschema
Class MultiCurveImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryImpl
      extended by org.deegree.model.spatialschema.AggregateImpl
          extended by org.deegree.model.spatialschema.MultiPrimitiveImpl
              extended by org.deegree.model.spatialschema.MultiCurveImpl
All Implemented Interfaces:
java.io.Serializable, Aggregate, Geometry, MultiCurve, MultiPrimitive

public class MultiCurveImpl
extends MultiPrimitiveImpl
implements MultiCurve, java.io.Serializable

default implementation of the MultiCurve interface from package deegree.model.spatialschema. ------------------------------------------------------------

Version:
12.6.2001
Author:
Andreas Poth
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.model.spatialschema.AggregateImpl
aggregate
 
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 MultiCurveImpl(CoordinateSystem crs)
          Creates a new MultiCurveImpl object.
protected MultiCurveImpl(Curve[] curve)
          Creates a new MultiCurveImpl object.
protected MultiCurveImpl(Curve[] curve, CoordinateSystem crs)
          Creates a new MultiCurveImpl object.
 
Method Summary
 void addCurve(Curve curve)
          adds a Curve to the aggregation
protected  void calculateCentroid()
          calculates the centroid of the aggregation
protected  void calculateEnvelope()
          calculates the bounding box / envelope of the aggregation
protected  void calculateParam()
          calculates the centroid and envelope of the aggregation
 java.lang.Object clone()
           
 Curve[] getAllCurves()
          returns all Curves as array
 Boundary getBoundary()
          returns the boundary of the MultiCurve not implemented yet
 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.
 Curve getCurveAt(int index)
          returns the Curve at the submitted index.
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 void insertCurveAt(Curve curve, int index)
          inserts a Curve in the aggregation. all elements with an index equal or larger index will be moved. if index is larger then getSize() - 1 or smaller then 0 or curve equals null an exception will be thrown.
 boolean isMember(Curve curve)
          returns true if the submitted Curve is within the aggregation
 void removeAll()
          removes all Curve from the aggregation.
 Curve removeCurve(Curve curve)
          removes the submitted Curve from the aggregation
 Curve removeCurveAt(int index)
          removes the Curve at the submitted index from the aggregation. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.
 void setCurveAt(Curve curve, int index)
          sets the submitted Curve at the submitted index. the element at the position index will be removed. if index is larger then getSize() - 1 or smaller then 0 or curve equals null an exception will be thrown.
 
Methods inherited from class org.deegree.model.spatialschema.MultiPrimitiveImpl
getAllPrimitives, getPrimitiveAt, merge
 
Methods inherited from class org.deegree.model.spatialschema.AggregateImpl
add, equals, getAll, getIterator, getObjectAt, getSize, insertObjectAt, intersects, isEmpty, isMember, removeObject, removeObjectAt, setCoordinateSystem, setObjectAt, toString, translate
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
contains, contains, difference, distance, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, isValid, isWithinDistance, setEmpty, setTolerance, setValid, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.spatialschema.MultiPrimitive
getAllPrimitives, getPrimitiveAt
 
Methods inherited from interface org.deegree.model.spatialschema.Aggregate
add, getAll, getIterator, getObjectAt, getSize, insertObjectAt, isMember, merge, removeObject, removeObjectAt, setObjectAt
 
Methods inherited from interface org.deegree.model.spatialschema.Geometry
contains, contains, difference, distance, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, intersects, isEmpty, isWithinDistance, setTolerance, translate, union
 

Constructor Detail

MultiCurveImpl

protected MultiCurveImpl(CoordinateSystem crs)
Creates a new MultiCurveImpl object.

Parameters:
crs -

MultiCurveImpl

protected MultiCurveImpl(Curve[] curve)
Creates a new MultiCurveImpl object.

Parameters:
curve -

MultiCurveImpl

protected MultiCurveImpl(Curve[] curve,
                         CoordinateSystem crs)
Creates a new MultiCurveImpl object.

Parameters:
curve -
crs -
Method Detail

addCurve

public void addCurve(Curve curve)
adds a Curve to the aggregation

Specified by:
addCurve in interface MultiCurve
Parameters:
curve - to add.

insertCurveAt

public void insertCurveAt(Curve curve,
                          int index)
                   throws GeometryException
inserts a Curve in the aggregation. all elements with an index equal or larger index will be moved. if index is larger then getSize() - 1 or smaller then 0 or curve equals null an exception will be thrown.

Specified by:
insertCurveAt in interface MultiCurve
Parameters:
curve - Curve to insert.
index - position where to insert the new Curve
Throws:
GeometryException

setCurveAt

public void setCurveAt(Curve curve,
                       int index)
                throws GeometryException
sets the submitted Curve at the submitted index. the element at the position index will be removed. if index is larger then getSize() - 1 or smaller then 0 or curve equals null an exception will be thrown.

Specified by:
setCurveAt in interface MultiCurve
Parameters:
curve - Curve to set.
index - position where to set the new Curve
Throws:
GeometryException

removeCurve

public Curve removeCurve(Curve curve)
removes the submitted Curve from the aggregation

Specified by:
removeCurve in interface MultiCurve
Returns:
the removed Curve

removeCurveAt

public Curve removeCurveAt(int index)
                    throws GeometryException
removes the Curve at the submitted index from the aggregation. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.

Specified by:
removeCurveAt in interface MultiCurve
Returns:
the removed Curve
Throws:
GeometryException

removeAll

public void removeAll()
removes all Curve from the aggregation.

Specified by:
removeAll in interface Aggregate
Overrides:
removeAll in class AggregateImpl

getCurveAt

public Curve getCurveAt(int index)
returns the Curve at the submitted index.

Specified by:
getCurveAt in interface MultiCurve
Returns:
the Curve at the submitted index. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.

getAllCurves

public Curve[] getAllCurves()
returns all Curves as array

Specified by:
getAllCurves in interface MultiCurve
Returns:
all Curves as array

isMember

public boolean isMember(Curve curve)
returns true if the submitted Curve is within the aggregation

Parameters:
curve -
Returns:
true if the submitted Curve is within the aggregation

getBoundary

public Boundary getBoundary()
returns the boundary of the MultiCurve

not implemented yet

Specified by:
getBoundary in interface Geometry
Overrides:
getBoundary in class GeometryImpl
Returns:
null

calculateEnvelope

protected void calculateEnvelope()
calculates the bounding box / envelope of the aggregation


calculateCentroid

protected void calculateCentroid()
calculates the centroid of the aggregation


calculateParam

protected void calculateParam()
calculates the centroid and envelope of the aggregation

Overrides:
calculateParam in class MultiPrimitiveImpl

getDimension

public int getDimension()
Description copied from interface: Geometry
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
Overrides:
getDimension in class MultiPrimitiveImpl
Returns:
dimension

getCoordinateDimension

public int getCoordinateDimension()
Description copied from interface: Geometry
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
Overrides:
getCoordinateDimension in class MultiPrimitiveImpl
Returns:
-1

clone

public java.lang.Object clone()
Overrides:
clone in class GeometryImpl

deegree 2.5 (2011/06/29 09:44 build-8-official)

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