| java.lang.Object org.geotools.data.AbstractFeatureSource org.geotools.data.AbstractFeatureStore
All known Subclasses: org.geotools.data.postgis.VersionedPostgisFeatureStore, org.geotools.data.AbstractFeatureLocking,
AbstractFeatureStore | abstract public class AbstractFeatureStore extends AbstractFeatureSource implements FeatureStore(Code) | | This is a starting point for providing your own FeatureStore implementation.
author: Jody Garnett, Refractions Research |
transaction | protected Transaction transaction(Code) | | Current Transaction this FeatureSource is opperating against
|
AbstractFeatureStore | public AbstractFeatureStore()(Code) | | |
AbstractFeatureStore | public AbstractFeatureStore(Set hints)(Code) | | This constructors allows to set the supported hints
Parameters: hints - |
addFeatures | public Set addFeatures(FeatureReader reader) throws IOException(Code) | | Add Features from reader to this FeatureStore.
Equivelent to:
Set set = new HashSet();
FeatureWriter writer = dataStore.getFeatureWriter( typeName, true, transaction );
Featrue feature, newFeature;
while( reader.hasNext() ){
feature = reader.next();
newFeature = writer.next();
newFeature.setAttributes( feature.getAttribtues( null ) );
writer.write();
set.add( newfeature.getID() );
}
reader.close();
writer.close();
return set;
(If you don't have a FeatureReader handy DataUtilities.reader() may be
able to help out)
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: reader - The Set of FeatureIDs added throws: IOException - If we encounter a problem encounter writing content throws: DataSourceException - See IOException See Also: org.geotools.data.FeatureStore.addFeatures(org.geotools.data.FeatureReader) |
getTransaction | public Transaction getTransaction()(Code) | | Retrieve the Transaction this FeatureSource is opperating against.
Transaction FeatureSource is operating against |
modifyFeatures | public void modifyFeatures(AttributeType type, Object value, Filter filter) throws IOException(Code) | | Modifies features matching filter .
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, filter, transaction );
while( writer.hasNext() ){
feature = writer.next();
feature.setAttribute( type.getName(), value );
writer.write();
}
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: type - Attribute to modify Parameters: value - Modification being made to type Parameters: filter - Identifies features to modify throws: IOException - If modification could not be made |
modifyFeatures | public void modifyFeatures(AttributeType[] type, Object[] value, Filter filter) throws IOException(Code) | | Modifies features matching filter .
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, filter, transaction );
Feature feature;
while( writer.hasNext() ){
feature = writer.next();
feature.setAttribute( type[0].getName(), value[0] );
feature.setAttribute( type[1].getName(), value[1] );
...
feature.setAttribute( type[N].getName(), value[N] );
writer.write();
}
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: type - Attributes to modify Parameters: value - Modifications being made to type Parameters: filter - Identifies features to modify throws: IOException - If we could not modify Feature throws: DataSourceException - See IOException |
removeFeatures | public void removeFeatures(Filter filter) throws IOException(Code) | | Removes features indicated by provided filter.
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, filter, transaction );
Feature feature;
while( writer.hasNext() ){
feature = writer.next();
writer.remove();
}
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: filter - Identifies features to remove throws: IOException - |
setFeatures | public void setFeatures(FeatureReader reader) throws IOException(Code) | | Replace with contents of reader.
Equivelent to:
FeatureWriter writer = dataStore.getFeatureWriter( typeName, false, transaction );
Feature feature, newFeature;
while( writer.hasNext() ){
feature = writer.next();
writer.remove();
}
while( reader.hasNext() ){
newFeature = reader.next();
feature = writer.next();
newFeature.setAttributes( feature.getAttributes( null ) );
writer.write();
}
reader.close();
writer.close();
Subclasses may override this method to perform the appropriate
optimization for this result.
Parameters: reader - Contents to replace with throws: IOException - if anything goes wrong during replacement throws: DataSourceException - See IOException |
Fields inherited from org.geotools.data.AbstractFeatureSource | protected Set hints(Code)(Java Doc)
|
|
|