org.geotools.data
Class DefaultTypeEntry

java.lang.Object
  extended byorg.geotools.data.DefaultTypeEntry
All Implemented Interfaces:
CatalogEntry, TypeEntry

public class DefaultTypeEntry
extends java.lang.Object
implements TypeEntry

Default impelmentation of TypeEntry.

This implemenation is entirely dependent on the DataStore api, it does cache values and listen to events.

For an alternative take see data.store.*, AbstractDataStore2 is entirly dependendent on TypeEntry_GT.

Since:
0.3
Author:
jgarnett

Constructor Summary
DefaultTypeEntry(DataStore store, java.net.URI namespace, java.lang.String typeName)
           
 
Method Summary
protected  com.vividsolutions.jts.geom.Envelope createBounds()
          Override to provide your own optimized calculation of bbox.
protected  java.util.Map createMetadata()
          Lazy creatation of metdata, subclass overrride recomended.
 boolean equals(java.lang.Object obj)
          Equals based only on resource definition information (not connection information).
 void fireAdded(Feature newFeature, Transaction transaction)
          TODO summary sentence for fireAdded ...
 void fireChanged(Feature before, Feature after, Transaction transaction)
          TODO summary sentence for fireChanged ...
 void fireRemoved(Feature removedFeature, Transaction transaction)
          TODO summary sentence for fireRemoved ...
 com.vividsolutions.jts.geom.Envelope getBounds()
          Bounding box for associated Feature Collection, will be calcualted as needed.
 int getCount()
          Number of features in associated Feature Collection, will be calcualted as needed
 java.lang.String getDataName()
          namespace:typename
 org.opengis.util.InternationalString getDescription()
           
 org.opengis.util.InternationalString getDisplayName()
           
 FeatureSource getFeatureSource()
          Aquire featuresource
 FeatureType getFeatureType()
          Aquire featureType.
 java.lang.String[] getMetadataNames()
          Quick access to metadata.keySet.
 java.net.URI getNamespace()
           
 java.lang.String getTypeName()
           
 int hashCode()
          Hashcode based on typename, uri and store.
 java.util.Map metadata()
          Access to map of metadata by name.
 void reset()
          Called to reset the count and bounds, they will be recalculated as needed
 java.lang.Object resource()
          Each CatalogEntry describes a resource, this method provides access to that resource.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTypeEntry

public DefaultTypeEntry(DataStore store,
                        java.net.URI namespace,
                        java.lang.String typeName)
Method Detail

resource

public java.lang.Object resource()
Description copied from interface: CatalogEntry
Each CatalogEntry describes a resource, this method provides access to that resource.

Specified by:
resource in interface CatalogEntry
Returns:
The resource described by current CatalogEntry.

getFeatureSource

public FeatureSource getFeatureSource()
                               throws java.io.IOException
Aquire featuresource

Specified by:
getFeatureSource in interface TypeEntry
Returns:
Throws:
java.io.IOException
See Also:
TypeEntry.getFeatureSource()

getFeatureType

public FeatureType getFeatureType()
                           throws java.io.IOException
Aquire featureType.

Specified by:
getFeatureType in interface TypeEntry
Returns:
Throws:
java.io.IOException
See Also:
TypeEntry.getFeatureType()

metadata

public java.util.Map metadata()
Access to map of metadata by name.

Specified by:
metadata in interface CatalogEntry
Returns:
Map of metadata by name
See Also:
CatalogEntry.metadata()

createMetadata

protected java.util.Map createMetadata()
Lazy creatation of metdata, subclass overrride recomended.

By default returns an empty Map

Returns:
Map of fresh metadata

getMetadataNames

public java.lang.String[] getMetadataNames()
Quick access to metadata.keySet.

Specified by:
getMetadataNames in interface CatalogEntry
Returns:
Metadata names
See Also:
CatalogEntry.getMetadataNames()

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: TypeEntry
Equals based only on resource definition information (not connection information).

Specified by:
equals in interface TypeEntry

hashCode

public int hashCode()
Hashcode based on typename, uri and store.

Specified by:
hashCode in interface TypeEntry
Returns:
hashcode based on typename, entry and uri.

reset

public void reset()
Called to reset the count and bounds, they will be recalculated as needed


getDisplayName

public org.opengis.util.InternationalString getDisplayName()
Specified by:
getDisplayName in interface TypeEntry

getDataName

public java.lang.String getDataName()
namespace:typename

Specified by:
getDataName in interface CatalogEntry
Returns:
The name of the associated data.

getDescription

public org.opengis.util.InternationalString getDescription()
Specified by:
getDescription in interface TypeEntry

getNamespace

public java.net.URI getNamespace()

getTypeName

public java.lang.String getTypeName()

getBounds

public com.vividsolutions.jts.geom.Envelope getBounds()
Bounding box for associated Feature Collection, will be calcualted as needed.

Note bounding box is returned in lat/long - the coordinate system of the default geometry is used to provide this reprojection.

Specified by:
getBounds in interface TypeEntry

createBounds

protected com.vividsolutions.jts.geom.Envelope createBounds()
Override to provide your own optimized calculation of bbox.

Default impelmenation uses the a feature source.

Returns:
BBox in lat long

getCount

public int getCount()
Number of features in associated Feature Collection, will be calcualted as needed

Specified by:
getCount in interface TypeEntry

fireAdded

public void fireAdded(Feature newFeature,
                      Transaction transaction)
TODO summary sentence for fireAdded ...

Specified by:
fireAdded in interface TypeEntry
Parameters:
newFeature -
transaction -
See Also:
TypeEntry.fireAdded(org.geotools.feature.Feature, org.geotools.data.Transaction)

fireChanged

public void fireChanged(Feature before,
                        Feature after,
                        Transaction transaction)
TODO summary sentence for fireChanged ...

Specified by:
fireChanged in interface TypeEntry
Parameters:
before -
after -
transaction -
See Also:
TypeEntry.fireChanged(org.geotools.feature.Feature, org.geotools.feature.Feature, org.geotools.data.Transaction)

fireRemoved

public void fireRemoved(Feature removedFeature,
                        Transaction transaction)
TODO summary sentence for fireRemoved ...

Specified by:
fireRemoved in interface TypeEntry
Parameters:
removedFeature -
transaction -
See Also:
TypeEntry.fireRemoved(org.geotools.feature.Feature, org.geotools.data.Transaction)


Copyright © GeoTools. All Rights Reserved.