org.deegree.model.geometry
Interface GM_Aggregate

All Superinterfaces:
GM_Object
All Known Subinterfaces:
GM_MultiCurve, GM_MultiPoint, GM_MultiPrimitive, GM_MultiSolid, GM_MultiSurface
All Known Implementing Classes:
GM_Aggregate_Impl, GM_MultiCurve_Impl, GM_MultiPoint_Impl, GM_MultiPrimitive_Impl, GM_MultiSurface_Impl

public interface GM_Aggregate
extends GM_Object

This interface defines the basis functionallity of all geometry aggregations. it will be specialized for the use of primitive, and solid geometries.

-----------------------------------------------------

Version:
$Revision: 1.2 $ $Date: 2004/03/11 08:25:33 $

Author:
Andreas Poth

Method Summary
 void add(GM_Object gmo)
          adds an GM_Object to the aggregation
 GM_Object[] getAll()
          returns all GM_Objects as array
 java.util.Iterator getIterator()
          returns the aggregation as an iterator
 GM_Object getObjectAt(int index)
          returns the GM_Object at the submitted index.
 int getSize()
          returns the number of GM_Object within the aggregation
 void insertObjectAt(GM_Object gmo, int index)
          inserts a GM_Object in the aggregation. all elements with an index equal or larger index will be moved. if index is larger then getSize() - 1 an exception will be thrown.
 boolean isMember(GM_Object gmo)
          returns true if the submitted GM_Object is within the aggregation
 void merge(GM_Aggregate aggregate)
          merges two aggregation.
 void removeAll()
          removes all GM_Object from the aggregation.
 GM_Object removeObject(GM_Object gmo)
          removes the submitted GM_Object from the aggregation
 GM_Object removeObjectAt(int index)
          removes the GM_Object at the submitted index from the aggregation.
 void setObjectAt(GM_Object gmo, int index)
          sets the submitted GM_Object at the submitted index. the element at the position index will be removed. if index is larger then getSize() - 1 an exception will be thrown.
 
Methods inherited from interface org.deegree.model.geometry.GM_Object
contains, contains, difference, distance, getBoundary, getBuffer, getCentroid, getConvexHull, getCoordinateDimension, getCoordinateSystem, getDimension, getEnvelope, intersection, intersects, isEmpty, isWithinDistance, translate, union
 

Method Detail

getSize

public int getSize()
returns the number of GM_Object within the aggregation


merge

public void merge(GM_Aggregate aggregate)
           throws GM_Exception
merges two aggregation.

Throws:
GM_Exception - a GM_Exception will be thrown if the submitted isn't the same type as the recieving one.

add

public void add(GM_Object gmo)
adds an GM_Object to the aggregation


insertObjectAt

public void insertObjectAt(GM_Object gmo,
                           int index)
                    throws GM_Exception
inserts a GM_Object in the aggregation. all elements with an index equal or larger index will be moved. if index is larger then getSize() - 1 an exception will be thrown.

Parameters:
gmo - GM_Object to insert.
index - position where to insert the new GM_Object
Throws:
GM_Exception

setObjectAt

public void setObjectAt(GM_Object gmo,
                        int index)
                 throws GM_Exception
sets the submitted GM_Object at the submitted index. the element at the position index will be removed. if index is larger then getSize() - 1 an exception will be thrown.

Parameters:
gmo - GM_Object to set.
index - position where to set the new GM_Object
Throws:
GM_Exception

removeObject

public GM_Object removeObject(GM_Object gmo)
removes the submitted GM_Object from the aggregation

Returns:
the removed GM_Object

removeObjectAt

public GM_Object removeObjectAt(int index)
                         throws GM_Exception
removes the GM_Object at the submitted index from the aggregation. if index is larger then getSize() - 1 an exception will be thrown.

Returns:
the removed GM_Object
Throws:
GM_Exception

removeAll

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


getObjectAt

public GM_Object getObjectAt(int index)
returns the GM_Object at the submitted index.


getAll

public GM_Object[] getAll()
returns all GM_Objects as array


isMember

public boolean isMember(GM_Object gmo)
returns true if the submitted GM_Object is within the aggregation


getIterator

public java.util.Iterator getIterator()
returns the aggregation as an iterator