|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides storage of data for Features.
Individual shapefiles, database tables, etc. are modified through this interface.
This is a prototype DataSource replacement please see FeatureSource for more information.
Method Summary | |
java.util.Set |
addFeatures(FeatureReader reader)
Adds all features from the passed feature collection to the datasource. |
Transaction |
getTransaction()
Used to access the Transaction this DataSource is currently opperating against. |
void |
modifyFeatures(AttributeType[] type,
java.lang.Object[] value,
Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
modifyFeatures(AttributeType type,
java.lang.Object value,
Filter filter)
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. |
void |
removeFeatures(Filter filter)
Removes all of the features specificed by the passed filter from the collection. |
void |
setFeatures(FeatureReader reader)
Deletes the all the current Features of this datasource and adds the new collection. |
void |
setTransaction(Transaction transaction)
Provides a transaction for commit/rollback control of this FeatureStore. |
Methods inherited from interface org.geotools.data.FeatureSource |
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getSchema, removeFeatureListener |
Method Detail |
public java.util.Set addFeatures(FeatureReader reader) throws java.io.IOException
reader
- The reader from which to add the features.
DataSourceException
- if anything goes wrong.
java.lang.UnsupportedOperationException
- if the addFeatures method is not
supported by this datasource.
java.io.IOException
public void removeFeatures(Filter filter) throws java.io.IOException
filter
- An OpenGIS filter; specifies which features to remove.
DataSourceException
- If anything goes wrong.
java.lang.UnsupportedOperationException
- if the removeFeatures method is
not supported by this datasource.
java.io.IOException
public void modifyFeatures(AttributeType[] type, java.lang.Object[] value, Filter filter) throws java.io.IOException
type
- The attributes to modify.value
- The values to put in the attribute types.filter
- An OGC filter to note which attributes to modify.
DataSourceException
- if the attribute and object arrays are not
eqaul length, if the object types do not match the attribute
types, or if there are backend errors.
java.lang.UnsupportedOperationException
- if the modifyFeatures method is
not supported by this datasource.
java.io.IOException
public void modifyFeatures(AttributeType type, java.lang.Object value, Filter filter) throws java.io.IOException
type
- The attributes to modify.value
- The values to put in the attribute types.filter
- An OGC filter to note which attributes to modify.
DataSourceException
- If modificaton is not supported, if the
object type do not match the attribute type.
java.lang.UnsupportedOperationException
- if the modifyFeatures method is
not supported by this datasource.
java.io.IOException
public void setFeatures(FeatureReader reader) throws java.io.IOException
reader
- - the collection to be written
DataSourceException
- if there are any datasource errors.
java.lang.UnsupportedOperationException
- if the setFeatures method is not
supported by this datasource.
java.io.IOException
public void setTransaction(Transaction transaction)
This method operates as a replacement for setAutoCommitMode. When a transaction is provided you are no longer automatically committing.
In order to return to AutoCommit mode supply the Transaction.AUTO_COMMIT to this method. Since this represents a return to AutoCommit mode the previous Transaction will be commited.
DataSourceException
- if there are any datasource errors.public Transaction getTransaction()
Example Use: adding features to a road DataSource
Transaction t = roads.getTransaction();
try{
roads.addFeatures( features );
roads.getTransaction().commit();
}
catch( IOException erp ){
//something went wrong;
roads.getTransaction().rollback();
}
Transaction.AUTO_COMMIT
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |