com.hardcode.gdbms.engine.data.command
Class UndoableSpatialDataSource

java.lang.Object
  extended by com.hardcode.gdbms.engine.data.command.AbstractUndoableDataSource
      extended by com.hardcode.gdbms.engine.data.command.UndoableSpatialDataSource
All Implemented Interfaces:
DataSource, ReadAccess, SpatialDataSource

public class UndoableSpatialDataSource
extends AbstractUndoableDataSource
implements SpatialDataSource


Field Summary
 
Fields inherited from class com.hardcode.gdbms.engine.data.command.AbstractUndoableDataSource
cs, dataSource
 
Fields inherited from interface com.hardcode.gdbms.engine.data.SpatialDataSource
ANY, LINE, MULTILINE, MULTIPOINT, MULTIPOLYGON, POINT, POLYGON
 
Fields inherited from interface com.hardcode.gdbms.engine.data.DataSource
COHERENT_ROW_ORDER, DIRECT_MODE, DISPATCH, IGNORE, STORE
 
Constructor Summary
UndoableSpatialDataSource(DataSource ds)
           
 
Method Summary
 void buildIndex()
          Builds a spatial index.
 void clearIndex()
          Clears the spatial index.
 void deleteRow(long rowId)
          Deletes the ith row of the DataSource if there is no spatial index.
 java.awt.geom.Rectangle2D getFullExtent()
          Gets the full extent of the data accessed
 java.awt.geom.Rectangle2D getGeometryBounds(long rowIndex)
          Gets the bounds of the geometry at the specified index.
 int getGeometryType()
          Gets the geometry type of the data source.
 int getSpatialFieldIndex()
          Returns the index of the field containing spatial data
 void insertEmptyRow()
          Inserts a row at the end of the dataware
 void insertEmptyRowAt(long index)
          Inserts an empty row at the end of the dataware.
 void insertFilledRow(Value[] values)
          Inserts a row at the end of the dataware with the specified values
 void insertFilledRowAt(long index, Value[] values)
          Inserts a row at the specified index with the specified values.
 boolean isIndexed()
           
 java.util.List queryIndex(java.awt.geom.Rectangle2D area)
          Queries the index and gets a List of Integer's with the indexes of those rows of the DataSource near the argument
 
Methods inherited from class com.hardcode.gdbms.engine.data.command.AbstractUndoableDataSource
addEditionListener, addField, addField, addMetadataEditionListener, addSelectionListener, beginTrans, canRedo, canUndo, check, commitTrans, getAlias, getAsString, getDataSourceFactory, getDataSourceMetadata, getDispatchingMode, getDriver, getDriverMetadata, getEmptyRow, getFieldIndexByName, getFieldNames, getFieldValue, getMemento, getName, getRow, getRowCount, getSelectedRows, getWhereFilter, isModified, redo, remove, removeEditionListener, removeField, removeMetadataEditionListener, removeSelectionListener, rollBackTrans, saveData, setDataSourceFactory, setDispatchingMode, setFieldName, setFieldValue, setSelectedRows, start, stop, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hardcode.gdbms.engine.data.DataSource
addEditionListener, addField, addField, addMetadataEditionListener, addSelectionListener, beginTrans, canRedo, canUndo, check, commitTrans, getAlias, getAsString, getDataSourceFactory, getDataSourceMetadata, getDispatchingMode, getDriver, getDriverMetadata, getFieldIndexByName, getFieldNames, getMemento, getName, getRow, getSelectedRows, getWhereFilter, isModified, redo, remove, removeEditionListener, removeField, removeMetadataEditionListener, removeSelectionListener, rollBackTrans, saveData, setDataSourceFactory, setDispatchingMode, setFieldName, setFieldValue, setSelectedRows, start, stop, undo
 
Methods inherited from interface com.hardcode.gdbms.engine.data.driver.ReadAccess
getFieldValue, getRowCount
 

Constructor Detail

UndoableSpatialDataSource

public UndoableSpatialDataSource(DataSource ds)
Method Detail

deleteRow

public void deleteRow(long rowId)
               throws DriverException
Description copied from interface: SpatialDataSource
Deletes the ith row of the DataSource if there is no spatial index. If there is, it sets all its values to null

Specified by:
deleteRow in interface SpatialDataSource
Parameters:
rowId - index of the row to be deleted
Throws:
DriverException - if the row could not be deleted

insertFilledRowAt

public void insertFilledRowAt(long index,
                              Value[] values)
                       throws DriverException,
                              java.lang.UnsupportedOperationException
Description copied from interface: SpatialDataSource
Inserts a row at the specified index with the specified values. It won't work if there is a spatial index

Specified by:
insertFilledRowAt in interface SpatialDataSource
Parameters:
index - index where the row will be inserted. No data is lost.
values - Values of the inserted row fields in the field order
Throws:
DriverException - if the row could not be inserted
java.lang.UnsupportedOperationException - If there is a spatial index

insertEmptyRowAt

public void insertEmptyRowAt(long index)
                      throws DriverException,
                             java.lang.UnsupportedOperationException
Description copied from interface: SpatialDataSource
Inserts an empty row at the end of the dataware. It won't work if there is a spatial index

Specified by:
insertEmptyRowAt in interface SpatialDataSource
Parameters:
index - index where the row will be inserted. No data is lost.
Throws:
DriverException - if the row could not be inserted
java.lang.UnsupportedOperationException - if there is a spatial index

insertFilledRow

public void insertFilledRow(Value[] values)
                     throws DriverException
Description copied from interface: DataSource
Inserts a row at the end of the dataware with the specified values

Specified by:
insertFilledRow in interface DataSource
Parameters:
values - Values of the inserted row fields in the field order
Throws:
DriverException - if the row could not be inserted

insertEmptyRow

public void insertEmptyRow()
                    throws DriverException
Description copied from interface: DataSource
Inserts a row at the end of the dataware

Specified by:
insertEmptyRow in interface DataSource
Throws:
DriverException - if the row could not be inserted

getFullExtent

public java.awt.geom.Rectangle2D getFullExtent()
                                        throws DriverException
Description copied from interface: SpatialDataSource
Gets the full extent of the data accessed

Specified by:
getFullExtent in interface SpatialDataSource
Returns:
Rectangle2D
Throws:
DriverException - if the operation fails

getGeometryType

public int getGeometryType()
                    throws DriverException
Description copied from interface: SpatialDataSource
Gets the geometry type of the data source.

Specified by:
getGeometryType in interface SpatialDataSource
Returns:
int
Throws:
DriverException

buildIndex

public void buildIndex()
                throws DriverException
Description copied from interface: SpatialDataSource
Builds a spatial index. A SpatialDataSource hasn't the same behaviour when there is an spatial index or not. So this operation causes the command history to be cleared

Specified by:
buildIndex in interface SpatialDataSource
Throws:
DriverException - If the build fails

clearIndex

public void clearIndex()
                throws DriverException
Description copied from interface: SpatialDataSource
Clears the spatial index. As the buildIndex method, this one clears the command history

Specified by:
clearIndex in interface SpatialDataSource
Throws:
DriverException

queryIndex

public java.util.List queryIndex(java.awt.geom.Rectangle2D area)
Description copied from interface: SpatialDataSource
Queries the index and gets a List of Integer's with the indexes of those rows of the DataSource near the argument

Specified by:
queryIndex in interface SpatialDataSource
Returns:
List of integer

isIndexed

public boolean isIndexed()
Specified by:
isIndexed in interface SpatialDataSource
Returns:
true if this datasource is spatially indexed and false otherwise

getSpatialFieldIndex

public int getSpatialFieldIndex()
                         throws DriverException
Description copied from interface: SpatialDataSource
Returns the index of the field containing spatial data

Specified by:
getSpatialFieldIndex in interface SpatialDataSource
Returns:
Throws:
DriverException

getGeometryBounds

public java.awt.geom.Rectangle2D getGeometryBounds(long rowIndex)
                                            throws DriverException
Description copied from interface: SpatialDataSource
Gets the bounds of the geometry at the specified index. If the geometry is NullValue, null is returned

Specified by:
getGeometryBounds in interface SpatialDataSource
Returns:
Throws:
DriverException


Copyright © 2005-2006 . All Rights Reserved.