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

org.deegree.model.spatialschema
Class MultiSurfaceImpl

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.MultiSurfaceImpl
All Implemented Interfaces:
java.io.Serializable, Aggregate, Geometry, MultiPrimitive, MultiSurface

public class MultiSurfaceImpl
extends MultiPrimitiveImpl
implements MultiSurface, java.io.Serializable

default implementation of the MultiSurface interface from

Version:
$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.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 MultiSurfaceImpl(CoordinateSystem crs)
          Creates a new MultiSurfaceImpl object.
protected MultiSurfaceImpl(Surface[] surface)
          Creates a new MultiSurfaceImpl object.
protected MultiSurfaceImpl(Surface[] surface, CoordinateSystem crs)
          Creates a new MultiSurfaceImpl object.
 
Method Summary
 void addSurface(Surface gms)
          adds an Surface to the aggregation
protected  void calculateParam()
          calculates the centroid, area and envelope of the aggregation
 java.lang.Object clone()
           
 Surface[] getAllSurfaces()
          returns all Surfaces as array
 double getArea()
          returns the area of the multi surface. this is calculate as the sum of all containing surface areas.
 int getCoordinateDimension()
          the dimension of the first contained surface.
 int getDimension()
          The operation "dimension" shall return the inherent dimension of this Geometry, which shall be less than or equal to the coordinate dimension.
 Surface getSurfaceAt(int index)
          returns the Surface at the submitted index.
 void insertSurfaceAt(Surface gms, int index)
          inserts a Surface 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 gms equals null an exception will be thrown.
 Surface removeSurface(Surface gms)
          removes the submitted Surface from the aggregation
 Surface removeSurfaceAt(int index)
          removes the Surface at the submitted index from the aggregation. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.
 void setSurfaceAt(Surface gms, int index)
          sets the submitted Surface 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 gms 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, removeAll, removeObject, removeObjectAt, setCoordinateSystem, setObjectAt, toString, translate
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
contains, contains, difference, distance, getBoundary, 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, removeAll, removeObject, removeObjectAt, setObjectAt
 
Methods inherited from interface org.deegree.model.spatialschema.Geometry
contains, contains, difference, distance, getBoundary, getBuffer, getBuffer, getCentroid, getConvexHull, getCoordinateSystem, getEnvelope, getTolerance, intersection, intersects, isEmpty, isWithinDistance, setTolerance, translate, union
 

Constructor Detail

MultiSurfaceImpl

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

Parameters:
crs -

MultiSurfaceImpl

protected MultiSurfaceImpl(Surface[] surface)
Creates a new MultiSurfaceImpl object.

Parameters:
surface -

MultiSurfaceImpl

protected MultiSurfaceImpl(Surface[] surface,
                           CoordinateSystem crs)
Creates a new MultiSurfaceImpl object.

Parameters:
surface -
crs -
Method Detail

addSurface

public void addSurface(Surface gms)
adds an Surface to the aggregation

Specified by:
addSurface in interface MultiSurface

insertSurfaceAt

public void insertSurfaceAt(Surface gms,
                            int index)
                     throws GeometryException
inserts a Surface 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 gms equals null an exception will be thrown.

Specified by:
insertSurfaceAt in interface MultiSurface
Parameters:
gms - Surface to insert.
index - position where to insert the new Surface
Throws:
GeometryException

setSurfaceAt

public void setSurfaceAt(Surface gms,
                         int index)
                  throws GeometryException
sets the submitted Surface 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 gms equals null an exception will be thrown.

Specified by:
setSurfaceAt in interface MultiSurface
Parameters:
gms - Surface to set.
index - position where to set the new Surface
Throws:
GeometryException

removeSurface

public Surface removeSurface(Surface gms)
removes the submitted Surface from the aggregation

Specified by:
removeSurface in interface MultiSurface
Returns:
the removed Surface

removeSurfaceAt

public Surface removeSurfaceAt(int index)
                        throws GeometryException
removes the Surface 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:
removeSurfaceAt in interface MultiSurface
Returns:
the removed Surface
Throws:
GeometryException

getSurfaceAt

public Surface getSurfaceAt(int index)
returns the Surface at the submitted index.

Specified by:
getSurfaceAt in interface MultiSurface
Returns:
the Surface at the submitted index.

getAllSurfaces

public Surface[] getAllSurfaces()
returns all Surfaces as array

Specified by:
getAllSurfaces in interface MultiSurface
Returns:
all Surfaces as an array

calculateParam

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

Overrides:
calculateParam in class MultiPrimitiveImpl

getArea

public double getArea()
returns the area of the multi surface. this is calculate as the sum of all containing surface areas.

Specified by:
getArea in interface MultiSurface
Returns:
area

clone

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

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:
2

getCoordinateDimension

public int getCoordinateDimension()
the dimension of the first contained surface.

Specified by:
getCoordinateDimension in interface Geometry
Overrides:
getCoordinateDimension in class MultiPrimitiveImpl
Returns:
-1

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