deegree 2.5 (2011/06/29 09:44 build-8-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:
java.io.Serializable, Aggregate, Geometry
Direct Known Subclasses:
MultiGeometryImpl, MultiPrimitiveImpl

public abstract class AggregateImpl
extends GeometryImpl
implements Aggregate, java.io.Serializable

default implementation of the Aggregate interface ------------------------------------------------------------

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

Field Summary
protected  java.util.ArrayList<Geometry> 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 AggregateImpl(CoordinateSystem crs)
          Creates a new AggregateImpl object.
 
Method Summary
 void add(Geometry gmo)
          adds an Geometry to the aggregation
 boolean equals(java.lang.Object other)
          Compares the Geometry to be equal to another Geometry.
 Geometry[] getAll()
          returns all Geometries as array
 java.util.Iterator<Geometry> getIterator()
           
 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()
           
 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()
           
 boolean isMember(Geometry gmo)
           
 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.
 java.lang.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, 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, getBuffer, getCentroid, getConvexHull, getCoordinateDimension, getCoordinateSystem, getDimension, getEnvelope, getTolerance, intersection, isWithinDistance, setTolerance, union
 

Field Detail

aggregate

protected java.util.ArrayList<Geometry> aggregate
Constructor Detail

AggregateImpl

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

Parameters:
crs -
Method Detail

getSize

public int getSize()
Specified by:
getSize in interface Aggregate
Returns:
the number of Geometry within the aggregation

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
Parameters:
gmo - Geometry to the aggregation

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
Parameters:
gmo - to remove
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
Parameters:
index - to get
Returns:
the Geometry at the submitted index.

getAll

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

Specified by:
getAll in interface Aggregate
Returns:
all Geometries as array

isMember

public boolean isMember(Geometry gmo)
Specified by:
isMember in interface Aggregate
Returns:
true if the submitted Geometry is within the aggregation

getIterator

public java.util.Iterator<Geometry> getIterator()
Specified by:
getIterator in interface Aggregate
Returns:
the aggregation as an iterator

isEmpty

public boolean isEmpty()
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)
Description copied from class: GeometryImpl
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
Parameters:
d - vector to translate the geometry with

equals

public boolean equals(java.lang.Object other)
Description copied from class: GeometryImpl
Compares the Geometry to be equal to another Geometry.

Overrides:
equals in class GeometryImpl
Parameters:
other - the Geometry to test for equality
Returns:
true if the objects are equal, else false

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 java.lang.String toString()
Overrides:
toString 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