org.geotools.feature.collection
Class BaseFeatureState

java.lang.Object
  extended byorg.geotools.feature.collection.FeatureState
      extended byorg.geotools.feature.collection.BaseFeatureState

public class BaseFeatureState
extends FeatureState

This is *not* a Feature - it is a Delegate used by FeatureCollection implementations as "mix-in", provides implementation of featureCollection events, featureType, and attribute access.

To use cut&paste the following code exactly:

 
 
 
 

On the bright side this means we can "fix" all the FeatureCollection implementations in one fell-swoop.

Since:
GeoTools 2.2
Author:
Jody Garnett, Refractions Reserach, Inc.

Field Summary
 
Fields inherited from class org.geotools.feature.collection.FeatureState
bounds, data
 
Constructor Summary
BaseFeatureState(ResourceCollection collection, FeatureType schema)
           
BaseFeatureState(ResourceCollection collection, FeatureType featureType, FeatureType schema)
           
 
Method Summary
 void addListener(CollectionListener listener)
          Adds a listener for collection events.
static FeatureType featureType(FeatureType schema)
          Construct a fake FeatureType of this FeatureCollection.
protected  void fireChange(java.util.Collection coll, int type)
           
protected  void fireChange(Feature[] features, int type)
          To let listeners know that something has changed.
protected  void fireChange(Feature feature, int type)
           
 FeatureType getChildFeatureType()
           
 FeatureType getFeatureType()
           
 java.lang.String getId()
           
 void removeListener(CollectionListener listener)
          Removes a listener for collection events.
 void setId(java.lang.String id)
           
 
Methods inherited from class org.geotools.feature.collection.FeatureState
fids, getAttribute, getAttribute, getAttributes, getBounds, getDefaultGeometry, getNumberOfAttributes, getParent, isFeatures, setAttribute, setAttribute, setDefaultGeometry, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFeatureState

public BaseFeatureState(ResourceCollection collection,
                        FeatureType schema)

BaseFeatureState

public BaseFeatureState(ResourceCollection collection,
                        FeatureType featureType,
                        FeatureType schema)
Method Detail

featureType

public static FeatureType featureType(FeatureType schema)
Construct a fake FeatureType of this FeatureCollection.

Unless a FeatureType was provided during consturction (or this method is overriden) a FeatureType will be generated based on getSchmea according to the following assumptions:

  • FeatureType is gml:AbstractFeatureCollectionType
  • first attribute is getSchema.typeName
  • the attribute FeatureType the same as returned by getSchema()


addListener

public void addListener(CollectionListener listener)
Adds a listener for collection events.

Specified by:
addListener in class FeatureState
Parameters:
listener - The listener to add

removeListener

public void removeListener(CollectionListener listener)
Removes a listener for collection events.

Specified by:
removeListener in class FeatureState
Parameters:
listener - The listener to remove

fireChange

protected void fireChange(Feature[] features,
                          int type)
To let listeners know that something has changed.

Specified by:
fireChange in class FeatureState

fireChange

protected void fireChange(Feature feature,
                          int type)
Overrides:
fireChange in class FeatureState

fireChange

protected void fireChange(java.util.Collection coll,
                          int type)
Overrides:
fireChange in class FeatureState

getFeatureType

public FeatureType getFeatureType()
Specified by:
getFeatureType in class FeatureState

getChildFeatureType

public FeatureType getChildFeatureType()
Specified by:
getChildFeatureType in class FeatureState

getId

public java.lang.String getId()
Specified by:
getId in class FeatureState

setId

public void setId(java.lang.String id)


Copyright © GeoTools. All Rights Reserved.