Class DirectoryFeatureSource
- Object
- 
- DirectoryFeatureSource
 
- 
- All Implemented Interfaces:
- FeatureSource<SimpleFeatureType,SimpleFeature>,- SimpleFeatureSource
 - Direct Known Subclasses:
- DirectoryFeatureStore
 
 public class DirectoryFeatureSource extends Object implements SimpleFeatureSource 
- 
- 
Constructor SummaryConstructors Constructor Description DirectoryFeatureSource(SimpleFeatureSource delegate)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFeatureListener(FeatureListener listener)Registers a listening object that will be notified of changes to thisFeatureSource.ReferencedEnvelopegetBounds()Get the spatial bounds of the feature data.ReferencedEnvelopegetBounds(Query query)Get the spatial bounds of the features that would be returned by the givenQuery.intgetCount(Query query)Gets the number of the features that would be returned by the givenQuery, taking into account any settings for max features and start index set on theQuery.DataAccess<SimpleFeatureType,SimpleFeature>getDataStore()Returns the data source, as aDataAccessobject, providing thisFeatureSource.SimpleFeatureCollectiongetFeatures()Retrieves all features in the form of aFeatureCollection.SimpleFeatureCollectiongetFeatures(Query query)Retrieves features, in the form of aFeatureCollection, based on aQuery.SimpleFeatureCollectiongetFeatures(Filter filter)Retrieves features, in the form of aFeatureCollection, based on an OGCFilter.ResourceInfogetInfo()Returns information describing thisFeatureSourcewhich may include title, description and spatial parameters.NamegetName()Returns the name of the features (strictly, the name of theAttributeDescriptorfor the features) accessible through thisFeatureSource.QueryCapabilitiesgetQueryCapabilities()Enquire what what query capabilities thisFeatureSourcenatively supports.SimpleFeatureTypegetSchema()Retrieves the schema (feature type) that will apply to features retrieved from thisFeatureSource.Set<RenderingHints.Key>getSupportedHints()Returns the set of hints that thisFeatureSourcesupports viaQueryrequests.voidremoveFeatureListener(FeatureListener listener)Removes an object from thisFeatureSource'slisteners.SimpleFeatureSourceunwrap()
 
- 
- 
- 
Constructor Detail- 
DirectoryFeatureSourcepublic DirectoryFeatureSource(SimpleFeatureSource delegate) 
 
- 
 - 
Method Detail- 
addFeatureListenerpublic void addFeatureListener(FeatureListener listener) Description copied from interface:FeatureSourceRegisters a listening object that will be notified of changes to thisFeatureSource.- Specified by:
- addFeatureListenerin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Parameters:
- listener- the new listener
 
 - 
getBoundspublic ReferencedEnvelope getBounds() throws IOException Description copied from interface:FeatureSourceGet the spatial bounds of the feature data. This is equivalent to callinggetBounds(Query.ALL).It is possible that this method will return null if the calculation of bounds is judged to be too costly by the implementing class. In this case, you might call getFeatures().getBounds()instead.- Specified by:
- getBoundsin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- The bounding envelope of the feature data; or nullif the bounds are unknown or too costly to calculate.
- Throws:
- IOException- on any errors calculating the bounds
 
 - 
getBoundspublic ReferencedEnvelope getBounds(Query query) throws IOException Description copied from interface:FeatureSourceGet the spatial bounds of the features that would be returned by the givenQuery.It is possible that this method will return null if the calculation of bounds is judged to be too costly by the implementing class. In this case, you might call getFeatures(query).getBounds()instead.- Specified by:
- getBoundsin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Parameters:
- query- the query to select features
- Returns:
- The bounding envelope of the feature data; or nullif the bounds are unknown or too costly to calculate.
- Throws:
- IOException- on any errors calculating the bounds
 
 - 
getCountpublic int getCount(Query query) throws IOException Description copied from interface:FeatureSourceGets the number of the features that would be returned by the givenQuery, taking into account any settings for max features and start index set on theQuery.It is possible that this method will return -1if the calculation of number of features is judged to be too costly by the implementing class. In this case, you might callgetFeatures(query).size()instead.Example use: int count = featureSource.getCount(); if( count == -1 ){ count = featureSource.getFeatures( "typeName", count ).size(); }- Specified by:
- getCountin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Parameters:
- query- the query to select features
- Returns:
- the numer of features that would be returned by the Query; or-1if this cannot be calculated.
- Throws:
- IOException- if there are errors getting the count
 
 - 
getDataStorepublic DataAccess<SimpleFeatureType,SimpleFeature> getDataStore() Description copied from interface:FeatureSourceReturns the data source, as aDataAccessobject, providing thisFeatureSource.- Specified by:
- getDataStorein interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- the data source providing this FeatureSource
 
 - 
getFeaturespublic SimpleFeatureCollection getFeatures() throws IOException Description copied from interface:FeatureSourceRetrieves all features in the form of aFeatureCollection.The following statements are equivalent: featureSource.getFeatures(); featureSource.getFeatures(Filter.INCLUDE); featureSource.getFeatures(Query.ALL);- Specified by:
- getFeaturesin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Specified by:
- getFeaturesin interface- SimpleFeatureSource
- Returns:
- features retrieved by the Query
- Throws:
- IOException- if the underlying data source cannot be accessed.
 
 - 
getFeaturespublic SimpleFeatureCollection getFeatures(Filter filter) throws IOException Description copied from interface:FeatureSourceRetrieves features, in the form of aFeatureCollection, based on an OGCFilter.- Specified by:
- getFeaturesin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Specified by:
- getFeaturesin interface- SimpleFeatureSource
- Parameters:
- filter- the filter to select features; must not be- null(use Filter.INCLUDE instead)
- Returns:
- features retrieved by the Filter
- Throws:
- IOException- if the underlying data source cannot be accessed.
- See Also:
- Filter
 
 - 
getFeaturespublic SimpleFeatureCollection getFeatures(Query query) throws IOException Description copied from interface:FeatureSourceRetrieves features, in the form of aFeatureCollection, based on aQuery.- Specified by:
- getFeaturesin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Specified by:
- getFeaturesin interface- SimpleFeatureSource
- Parameters:
- query- DataAccess query for requested information, such as typeName, maxFeatures and filter.
- Returns:
- features retrieved by the Query
- Throws:
- IOException- if the underlying data source cannot be accessed.
- See Also:
- Query
 
 - 
getInfopublic ResourceInfo getInfo() Description copied from interface:FeatureSourceReturns information describing thisFeatureSourcewhich may include title, description and spatial parameters. Note that in the returnedResourceInfoobject, the distinction between feature name and schema (feature type) name applies as discussed for FeatureSource.getName().- Specified by:
- getInfoin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
 
 - 
getNamepublic Name getName() Description copied from interface:FeatureSourceReturns the name of the features (strictly, the name of theAttributeDescriptorfor the features) accessible through thisFeatureSource.The value returned by this method can be different to that returned by featureSource.getSchema().getType().getName(). This is because there is a distinction between the name applied to features and the name of a feature type. When working withSimpleFeatureandSimpleFeatureType, for example with a shapefile data source, it is common practice for feature and feature type names to be the same. However, this is not the case more generally. For instance, a database can contain two tables with the same structure. The feature name will refer to the table while the feature type name refers to the schema (table structure).- Specified by:
- getNamein interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- the name of the features accessible through this FeatureSource
 
 - 
getQueryCapabilitiespublic QueryCapabilities getQueryCapabilities() Description copied from interface:FeatureSourceEnquire what what query capabilities thisFeatureSourcenatively supports. For example, whether queries can return sorted results.- Specified by:
- getQueryCapabilitiesin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- the native query capabilities of this FeatureSource
 
 - 
getSchemapublic SimpleFeatureType getSchema() Description copied from interface:FeatureSourceRetrieves the schema (feature type) that will apply to features retrieved from thisFeatureSource.For a homogeneous data source such as a shapefile or a database table, this schema be that of all features. For a heterogeneous data source, e.g. a GML document, the schema returned is the lowest common denominator across all features. - Specified by:
- getSchemain interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- the schema that will apply to features retrieved from this FeatureSource
 
 - 
getSupportedHintspublic Set<RenderingHints.Key> getSupportedHints() Description copied from interface:FeatureSourceReturns the set of hints that thisFeatureSourcesupports viaQueryrequests.Note: the existence of a specific hint does not guarantee that it will always be honored by the implementing class. - Specified by:
- getSupportedHintsin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Returns:
- a set of RenderingHints#Keyobjects; may be empty but nevernull
- See Also:
- Hints.FEATURE_DETACHED,- Hints.JTS_GEOMETRY_FACTORY,- Hints.JTS_COORDINATE_SEQUENCE_FACTORY,- Hints.JTS_PRECISION_MODEL,- Hints.JTS_SRID,- Hints.GEOMETRY_DISTANCE,- Hints.FEATURE_2D
 
 - 
removeFeatureListenerpublic void removeFeatureListener(FeatureListener listener) Description copied from interface:FeatureSourceRemoves an object from thisFeatureSource'slisteners.- Specified by:
- removeFeatureListenerin interface- FeatureSource<SimpleFeatureType,SimpleFeature>
- Parameters:
- listener- the listener to remove
 
 - 
unwrappublic SimpleFeatureSource unwrap() 
 
- 
 
-