org.geotools.data.store
Interface TypeEntry


public interface TypeEntry

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)
              Change notifcation
     void fireChanged(Feature before, Feature after, Transaction transaction)
              Change notifcation
     void fireRemoved(Feature removedFeature, Transaction transaction)
              Change notifcation
     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!
     

    Method Detail

    getDisplayName

    public org.opengis.util.InternationalString getDisplayName()
    Returns:
    user name for this feature collection

    getDescription

    public org.opengis.util.InternationalString getDescription()
    Returns:
    Description of this feature collection

    getFeatureType

    public FeatureType getFeatureType()
                               throws java.io.IOException
    Returns:
    Schema of this feature collection
    Throws:
    java.io.IOException - If resoruce is unavailable

    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.

    Returns:
    Enveloper for this FeatureCollection/FeatureType

    getCount

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

    Returns:
    number of features, may block while value is calculated, -1 indicates resource is unavailable

    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)
    Change notifcation

    Parameters:
    newFeature -
    transaction -

    fireRemoved

    public void fireRemoved(Feature removedFeature,
                            Transaction transaction)
    Change notifcation

    Parameters:
    removedFeature -
    transaction -

    fireChanged

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

    Parameters:
    before -
    after -
    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.