org.geotools.data
Interface TypeEntry

All Superinterfaces:
CatalogEntry
All Known Implementing Classes:
DefaultTypeEntry

public interface TypeEntry
extends CatalogEntry

Starting place for holding information about a FeatureType.

Like say for instance the FeatureType, its metadata and so on.

The default implemenation should contain enough information to wean us off of AbstractDataStore. That is it should provide its own locking and event notification.

There is a naming convention:

  • Feedback:

    Author:
    jgarnett

    Method Summary
     boolean equals(java.lang.Object obj)
              Equals based only on resource definition information (not connection information).
     void fireAdded(Feature newFeature, Transaction transaction)
               
     void fireChanged(Feature before, Feature after, Transaction transaction)
               
     void fireRemoved(Feature removedFeature, Transaction transaction)
               
     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
     org.opengis.util.InternationalString getDescription()
               
     org.opengis.util.InternationalString getDisplayName()
               
     FeatureSource getFeatureSource()
              Create a new FeatueSource allowing interaction with content.
     FeatureType getFeatureType()
               
     int hashCode()
              This hashcode is *VERY* important!
     
    Methods inherited from interface org.geotools.catalog.CatalogEntry
    getDataName, getMetadataNames, metadata, resource
     

    Method Detail

    getDisplayName

    public org.opengis.util.InternationalString getDisplayName()

    getDescription

    public org.opengis.util.InternationalString getDescription()

    getFeatureType

    public FeatureType getFeatureType()
                               throws java.io.IOException
    Throws:
    java.io.IOException

    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.


    getCount

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


    getFeatureSource

    public FeatureSource getFeatureSource()
                                   throws java.io.IOException
    Create a new FeatueSource allowing interaction with content.

    Subclass may optionally implement:

    • FeatureStore - to allow read/write access
    • FeatureLocking - for locking support
    This choice may even be made a runtime (allowing the api to represent a readonly file).

    Several default implemenations are provided

    Returns:
    FeatureLocking allowing access to content.
    Throws:
    java.io.IOException

    fireAdded

    public void fireAdded(Feature newFeature,
                          Transaction transaction)

    fireRemoved

    public void fireRemoved(Feature removedFeature,
                            Transaction transaction)

    fireChanged

    public void fireChanged(Feature before,
                            Feature after,
                            Transaction transaction)

    equals

    public boolean equals(java.lang.Object obj)
    Equals based only on resource definition information (not connection information).

    Parameters:
    obj -
    Returns:
    true if TypeEntry represents the same resource
    See Also:
    Object.equals(java.lang.Object)

    hashCode

    public int hashCode()
    This hashcode is *VERY* important!

    The hascode must be dependent only on the parameters that "define" the resource, not those that control opperation.

    • when representing a URL the hashcode must be: url.hashCode()
    • when representing a File the hashcode must be: file.toURL().hashcode()
    • when representing a database connection: hascode of jdbc url w/ out username, password

    Implemetnation tip - URL.hashCode is a blocking operation, so you calculate and cache when the URL changes, rather than block this method.

    Returns:
    hashCode based on resource definition
    See Also:
    Object.hashCode()


    Copyright © GeoTools. All Rights Reserved.