com.hardcode.gdbms.engine.data
Interface SpatialDataSource

All Superinterfaces:
DataSource, ReadAccess
All Known Implementing Classes:
DBSpatialDataSourceAdapter, SpatialFileDataSourceAdapter, SpatialObjectDataSourceAdapter, UndoableSpatialDataSource

public interface SpatialDataSource
extends DataSource

DataSource with spatial capabilities


Field Summary
static int ANY
           
static int LINE
           
static int MULTILINE
           
static int MULTIPOINT
           
static int MULTIPOLYGON
           
static int POINT
           
static int POLYGON
           
 
Fields inherited from interface com.hardcode.gdbms.engine.data.DataSource
COHERENT_ROW_ORDER, DIRECT_MODE, DISPATCH, IGNORE, STORE
 
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 insertEmptyRowAt(long index)
          Inserts an empty row at the end of the dataware.
 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 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, insertEmptyRow, insertFilledRow, 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
 

Field Detail

POINT

static final int POINT
See Also:
Constant Field Values

MULTIPOINT

static final int MULTIPOINT
See Also:
Constant Field Values

MULTILINE

static final int MULTILINE
See Also:
Constant Field Values

LINE

static final int LINE
See Also:
Constant Field Values

MULTIPOLYGON

static final int MULTIPOLYGON
See Also:
Constant Field Values

POLYGON

static final int POLYGON
See Also:
Constant Field Values

ANY

static final int ANY
See Also:
Constant Field Values
Method Detail

getFullExtent

java.awt.geom.Rectangle2D getFullExtent()
                                        throws DriverException
Gets the full extent of the data accessed

Returns:
Rectangle2D
Throws:
DriverException - if the operation fails

buildIndex

void buildIndex()
                throws DriverException
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

Throws:
DriverException - If the build fails

clearIndex

void clearIndex()
                throws DriverException
Clears the spatial index. As the buildIndex method, this one clears the command history

Throws:
DriverException

queryIndex

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

Parameters:
query - argument
Returns:
List of integer

isIndexed

boolean isIndexed()
Returns:
true if this datasource is spatially indexed and false otherwise

deleteRow

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

Parameters:
rowId - index of the row to be deleted
Throws:
DriverException - if the row could not be deleted

insertFilledRowAt

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

Parameters:
values - Values of the inserted row fields in the field order
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

insertEmptyRowAt

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

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

getGeometryType

int getGeometryType()
                    throws DriverException
Gets the geometry type of the data source.

Returns:
int
Throws:
DriverException

getSpatialFieldIndex

int getSpatialFieldIndex()
                         throws DriverException
Returns the index of the field containing spatial data

Returns:
Throws:
DriverException

getGeometryBounds

java.awt.geom.Rectangle2D getGeometryBounds(long rowIndex)
                                            throws DriverException
Gets the bounds of the geometry at the specified index. If the geometry is NullValue, null is returned

Parameters:
j -
Returns:
Throws:
DriverException


Copyright © 2005-2006 . All Rights Reserved.