deegree 2.2 (2008/12/22 11:33 build-3038-official)

org.deegree.model.spatialschema
Class AggregateImpl

java.lang.Object
  extended by org.deegree.model.spatialschema.GeometryImpl
      extended by org.deegree.model.spatialschema.AggregateImpl
All Implemented Interfaces:
Serializable, Aggregate, Geometry
Direct Known Subclasses:
MultiPrimitiveImpl

abstract class AggregateImpl
extends GeometryImpl
implements Aggregate, Serializable

default implementierung of the Aggregate interface ------------------------------------------------------------

Version:
8.6.2001
Author:
Andreas Poth href="mailto:poth@lat-lon.de"

Field Summary
protected  ArrayList<Geometry> aggregate
           
 
Fields inherited from class org.deegree.model.spatialschema.GeometryImpl
boundary, centroid, convexHull, crs, empty, envelope, mute, valid
 
Constructor Summary
AggregateImpl(CoordinateSystem crs)
          Creates a new AggregateImpl object.
 
Method Summary
 void add(Geometry gmo)
          adds an Geometry to the aggregation
 boolean equals(Object other)
          Compares the Geometry to be equal to another Geometry.
 Geometry[] getAll()
          returns all Geometries as array
 Iterator getIterator()
          returns the aggregation as an iterator
 Geometry getObjectAt(int index)
          returns the Geometry at the submitted index. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.
 int getSize()
          returns the number of Geometry within the aggregation
 void insertObjectAt(Geometry gmo, int index)
          inserts a Geometry 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 gmo equals null an exception will be thrown.
 boolean intersects(Geometry gmo)
          The Boolean valued operation "intersects" shall return TRUE if this Geometry intersects another Geometry.
 boolean isEmpty()
          returns true if no geometry stored within the collection.
 boolean isMember(Geometry gmo)
          returns true if the submitted Geometry is within the aggregation
 void merge(Aggregate aggregate)
          merges this aggregation with another one
 void removeAll()
          removes all Geometry from the aggregation.
 Geometry removeObject(Geometry gmo)
          removes the submitted Geometry from the aggregation
 Geometry removeObjectAt(int index)
          removes the Geometry at the submitted index from the aggregation. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.
 void setCoordinateSystem(CoordinateSystem crs)
          sets the spatial reference system
 void setObjectAt(Geometry gmo, int index)
          sets the submitted Geometry 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 gmo equals null an exception will be thrown.
 String toString()
           
 void translate(double[] d)
          translate the point by the submitted values. the dz- value will be ignored.
 
Methods inherited from class org.deegree.model.spatialschema.GeometryImpl
calculateParam, clone, contains, contains, difference, distance, getBoundary, 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.Geometry
contains, contains, difference, distance, getBoundary, getBuffer, getCentroid, getConvexHull, getCoordinateDimension, getCoordinateSystem, getDimension, getEnvelope, getTolerance, intersection, isWithinDistance, setTolerance, union
 

Field Detail

aggregate

protected ArrayList<Geometry> aggregate
Constructor Detail

AggregateImpl

public AggregateImpl(CoordinateSystem crs)
Creates a new AggregateImpl object.

Parameters:
crs -
Method Detail

getSize

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

Specified by:
getSize in interface Aggregate

merge

public void merge(Aggregate aggregate)
           throws GeometryException
merges this aggregation with another one

Specified by:
merge in interface Aggregate
Throws:
GeometryException - a GeometryException will be thrown if the submitted isn't the same type as the recieving one.

add

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

Specified by:
add in interface Aggregate

insertObjectAt

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

Specified by:
insertObjectAt in interface Aggregate
Parameters:
gmo - Geometry to insert.
index - position where to insert the new Geometry
Throws:
GeometryException

setObjectAt

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

Specified by:
setObjectAt in interface Aggregate
Parameters:
gmo - Geometry to set.
index - position where to set the new Geometry
Throws:
GeometryException

removeObject

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

Specified by:
removeObject in interface Aggregate
Returns:
the removed Geometry

removeObjectAt

public Geometry removeObjectAt(int index)
                        throws GeometryException
removes the Geometry 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:
removeObjectAt in interface Aggregate
Returns:
the removed Geometry
Throws:
GeometryException

removeAll

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

Specified by:
removeAll in interface Aggregate

getObjectAt

public Geometry getObjectAt(int index)
returns the Geometry at the submitted index. if index is larger then getSize() - 1 or smaller then 0 an exception will be thrown.

Specified by:
getObjectAt in interface Aggregate

getAll

public Geometry[] getAll()
returns all Geometries as array

Specified by:
getAll in interface Aggregate

isMember

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

Specified by:
isMember in interface Aggregate

getIterator

public Iterator getIterator()
returns the aggregation as an iterator

Specified by:
getIterator in interface Aggregate

isEmpty

public boolean isEmpty()
returns true if no geometry stored within the collection.

Specified by:
isEmpty in interface Geometry
Overrides:
isEmpty in class GeometryImpl
Returns:
true if no geometry values resp. points stored within the geometry.

setCoordinateSystem

public void setCoordinateSystem(CoordinateSystem crs)
sets the spatial reference system

Overrides:
setCoordinateSystem in class GeometryImpl
Parameters:
crs - new spatial reference system

translate

public void translate(double[] d)
translate the point by the submitted values. the dz- value will be ignored.

Specified by:
translate in interface Geometry
Overrides:
translate in class GeometryImpl

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

intersects

public boolean intersects(Geometry gmo)
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

toString

public String toString()
Overrides:
toString in class GeometryImpl
Returns:

deegree 2.2 (2008/12/22 11:33 build-3038-official)

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