org.deegree_impl.model.feature
Class FeatureCollection_Impl

java.lang.Object
  extended byorg.deegree_impl.model.feature.Feature_Impl
      extended byorg.deegree_impl.model.feature.FeatureCollection_Impl
All Implemented Interfaces:
Feature, FeatureCollection, java.io.Serializable

class FeatureCollection_Impl
extends Feature_Impl
implements FeatureCollection, java.io.Serializable

This interface provides services for the management of groups of features. These groups can come into being for a number of reasons: e.g. a project as a whole, for the scope of a query, as the result of a query or arbitrarily selected by a user for some common manipulation. A feature's membership of a particular FeatureCollection does not necessarily imply any relationship with other member features. Composite or compound features which own constituent member Features (e.g. an Airport composed of Terminals, Runways, Aprons, Hangars, etc) may also support the FeatureCollection interface to provide a generic means for clients to access constituent members without needing to be aware of the internal implementation details of the compound feature.

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

Version:
$Revision: 1.12 $ $Date: 2004/03/04 07:36:01 $
Author:
Andreas Poth

Field Summary
private  java.util.List collection
           
private  GM_Envelope envelope
           
private  FeatureType ft
           
 
Fields inherited from class org.deegree_impl.model.feature.Feature_Impl
featureType, geoProps, id, properties, propRef
 
Constructor Summary
(package private) FeatureCollection_Impl(java.lang.String id, Feature[] feature)
          constructor for initializing a featur collection with an id and an array of features.
(package private) FeatureCollection_Impl(java.lang.String id, FeatureType featureType, FeatureProperty[] properties, int initialCapacity)
           
(package private) FeatureCollection_Impl(java.lang.String id, int initialCapacity)
          constructor for initializing a featur collection with an id and a initial capacity.
 
Method Summary
 void appendFeature(Feature feature)
          Appends a feature to the collection.
 void appendFeatures(Feature[] features)
          adds a list of features to the collection
 void appendFeatures(FeatureCollection fc)
          adds a list of features to the collection
 Feature[] getAllFeatures()
          returns an array of all features
 GM_Envelope getEnvelope()
          returns the envelope / boundingbox of the feature collection
 Feature getFeature(int index)
          returns the feature that is assigned to the submitted index.
 Feature getFeatureById(java.lang.String id)
          returns the feature that is assigned to the submitted id.
 FeatureType getFeatureType()
          returns the FeatureType of this Feature(Collection)
 int getSize()
          returns the number of features within the collection
 Feature removeFeature(Feature feature)
          removes the submitted feature from the collection
 Feature removeFeature(int index)
          removes a feature identified by its index (row) from the the feature collection.
 Feature removeFeatureById(java.lang.String id)
          removes the feature that is assigned to the submitted id.
 java.lang.String toString()
           
 
Methods inherited from class org.deegree_impl.model.feature.Feature_Impl
getDefaultGeometryProperty, getGeometryProperties, getId, getProperties, getProperty, getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.model.feature.Feature
getDefaultGeometryProperty, getGeometryProperties, getId, getProperties, getProperty, getProperty, setProperty
 

Field Detail

collection

private java.util.List collection

ft

private FeatureType ft

envelope

private GM_Envelope envelope
Constructor Detail

FeatureCollection_Impl

FeatureCollection_Impl(java.lang.String id,
                       FeatureType featureType,
                       FeatureProperty[] properties,
                       int initialCapacity)

FeatureCollection_Impl

FeatureCollection_Impl(java.lang.String id,
                       int initialCapacity)
constructor for initializing a featur collection with an id and a initial capacity.


FeatureCollection_Impl

FeatureCollection_Impl(java.lang.String id,
                       Feature[] feature)
constructor for initializing a featur collection with an id and an array of features.

Method Detail

getFeatureType

public FeatureType getFeatureType()
returns the FeatureType of this Feature(Collection)

Specified by:
getFeatureType in interface Feature
Overrides:
getFeatureType in class Feature_Impl

getAllFeatures

public Feature[] getAllFeatures()
returns an array of all features

Specified by:
getAllFeatures in interface FeatureCollection

getFeature

public Feature getFeature(int index)
returns the feature that is assigned to the submitted index. If the submitted value for index is smaller 0 and larger then the number features within the featurecollection-1 an exeption will be thrown.

Specified by:
getFeature in interface FeatureCollection

getFeatureById

public Feature getFeatureById(java.lang.String id)
returns the feature that is assigned to the submitted id. If no valid feature could be found an Object[] with zero length will be returned.

Specified by:
getFeatureById in interface FeatureCollection

removeFeature

public Feature removeFeature(int index)
removes a feature identified by its index (row) from the the feature collection. The removed feature will be returned. If the submitted value for index is smaller 0 and larger then the number features within the featurecollection-1 an exeption will be thrown.

Specified by:
removeFeature in interface FeatureCollection

removeFeature

public Feature removeFeature(Feature feature)
removes the submitted feature from the collection

Specified by:
removeFeature in interface FeatureCollection

removeFeatureById

public Feature removeFeatureById(java.lang.String id)
removes the feature that is assigned to the submitted id. The removed feature will be returned. If no valid feature could be found null will be returned

Specified by:
removeFeatureById in interface FeatureCollection

appendFeature

public void appendFeature(Feature feature)
Appends a feature to the collection. If the submitted feature doesn't matches the feature type defined for all features within the collection an exception will be thrown.

Specified by:
appendFeature in interface FeatureCollection

appendFeatures

public void appendFeatures(Feature[] features)
Description copied from interface: FeatureCollection
adds a list of features to the collection

Specified by:
appendFeatures in interface FeatureCollection

appendFeatures

public void appendFeatures(FeatureCollection fc)
Description copied from interface: FeatureCollection
adds a list of features to the collection

Specified by:
appendFeatures in interface FeatureCollection

getSize

public int getSize()
returns the number of features within the collection

Specified by:
getSize in interface FeatureCollection

getEnvelope

public GM_Envelope getEnvelope()
returns the envelope / boundingbox of the feature collection

Specified by:
getEnvelope in interface Feature
Overrides:
getEnvelope in class Feature_Impl

toString

public java.lang.String toString()
Overrides:
toString in class Feature_Impl