|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hardcode.gdbms.engine.data.db.DBSpatialDataSourceAdapter
public class DBSpatialDataSourceAdapter
Field Summary |
---|
Fields inherited from interface com.hardcode.gdbms.engine.data.SpatialDataSource |
---|
ANY, LINE, MULTILINE, MULTIPOINT, MULTIPOLYGON, POINT, POLYGON |
Constructor Summary | |
---|---|
DBSpatialDataSourceAdapter(java.lang.String name,
java.lang.String alias,
DBSpatialSource def,
SpatialDBDriver driver)
Creates a new DBSpatialDataSourceAdapter |
Method Summary | |
---|---|
void |
addEditionListener(EditionListener listener)
Adds an EditionListener to the DataSource |
void |
addField(java.lang.String name,
java.lang.String type)
Adds a field to the DataSource |
void |
addField(java.lang.String name,
java.lang.String type,
java.lang.String[] paramNames,
java.lang.String[] paramValues)
Adds a field to the DataSource |
void |
addMetadataEditionListener(MetadataEditionListener listener)
Adds a listener for the Metadata edition events |
void |
addSelectionListener(SelectionListener listener)
Adds an SelectionListener to the DataSource |
void |
beginTrans()
Begins a transaction |
void |
buildIndex()
Builds a spatial index. |
boolean |
canRedo()
|
boolean |
canUndo()
|
java.lang.String |
check(int fieldId,
Value value)
Checks if this value is a valid one for the specified field. |
void |
clearIndex()
Clears the spatial index. |
void |
commitTrans()
Commits the changes made during the transaction. |
void |
deleteRow(long rowId)
Deletes the ith row of the DataSource if there is no spatial index. |
void |
endUndoRedoAction()
Notifies this DataSource that the next edition operations no longer are caused by an undo or redo operation |
void |
execute(java.lang.String sql)
|
java.lang.String |
getAlias()
Returns the alias used in this DataSource |
java.lang.String |
getAsString()
Gets the string representation of this DataSource |
java.sql.Connection |
getConnection()
|
DataSourceFactory |
getDataSourceFactory()
gets a reference to the factory object that created the DataSource |
Metadata |
getDataSourceMetadata()
Gets the meta data about the source of this DataSource |
int |
getDispatchingMode()
Gets the dispatchingMode property |
GDBMSDriver |
getDriver()
Gets the driver which this DataSource is over. |
DriverMetadata |
getDriverMetadata()
Gets the driver metadata |
int |
getFieldCount()
|
int |
getFieldIndexByName(java.lang.String fieldName)
Obtiene el indice de un campo a partir de su nombre o -1 si no existe un campo con ese nombre |
java.lang.String |
getFieldName(int fieldId)
|
java.lang.String[] |
getFieldNames()
Gets the field names array |
int |
getFieldType(int i)
|
Value |
getFieldValue(long rowIndex,
int fieldId)
Obtiene el valor que se encuentra en la fila y columna indicada |
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. |
Memento |
getMemento()
Gets a memento object with the current status of the DataSource |
java.lang.String |
getName()
Devuelve el nombre del DataSource |
DriverMetadata |
getOriginalDriverMetadata()
Gets the driver specific metadata from the driver directly without the new, modified or deleted fields |
int |
getOriginalFieldCount()
Gets the number of field this DataSource had before edition started |
Value |
getOriginalFieldValue(long rowIndex,
int fieldId)
Gets the value of the DataSource field before the edition started |
Metadata |
getOriginalMetadata()
Gets the Metadata from the driver without taking care of added, removed or modified fields. |
long |
getOriginalRowCount()
|
java.lang.String[] |
getPKNames()
|
ValueCollection |
getPKValue(long rowIndex)
|
Value[] |
getRow(long rowIndex)
Gets the value of all fields at the specified row |
long |
getRowCount()
Obtiene el número de registros del DataSource |
int[] |
getSelectedRows()
Gets the row selection |
int |
getSpatialFieldIndex()
Returns the index of the field containing spatial data |
int |
getType(java.lang.String driverType)
Returns the suitable GDBMS type for the given driver specific type |
long[] |
getWhereFilter()
Devuelve el filtro que resultó de la cláusula where de la instrucción que dió como resultado este DataSource. |
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()
|
boolean |
isModified()
Returns true if the DataSource has been modified since it was created. |
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 |
void |
redo()
Redoes the last undone edition action |
void |
remove()
Removes from the system the data source this DataSource instance represents. |
void |
removeEditionListener(EditionListener listener)
Removes an EditionListener from the DataSource |
void |
removeField(int index)
Removes the field at the indexth position |
void |
removeMetadataEditionListener(MetadataEditionListener listener)
Removes a listener for the Metadata edition events |
void |
removeSelectionListener(SelectionListener listener)
Removes an SelectionListener from the DataSource |
void |
rollBackTrans()
Cancels the changes made during the transaction |
void |
saveData(DataSource ds2)
Saves the data in the parameter DataSource in the source of this DataSource. |
void |
setAlias(java.lang.String alias)
|
void |
setDataSourceFactory(DataSourceFactory dsf)
Sets the DataSourceFactory that created the DataSource instance |
void |
setDispatchingMode(int dispatchingMode)
Defines the behaviour of the DataSource when an edition event happens. |
void |
setFieldName(int index,
java.lang.String name)
Sets the name of the field at the indexth position |
void |
setFieldValue(long row,
int fieldId,
Value value)
Sets the value of a cell of the table. |
void |
setName(java.lang.String name)
|
void |
setSelectedRows(int[] sel)
Sets the row selection |
void |
start()
Opens the DataSource to access the data it contains. |
void |
startUndoRedoAction()
Notifies this DataSource that the next edition operations are caused by an undo or redo operation |
void |
stop()
Closes the DataSource. |
void |
undo()
Undoes the last edition action |
void |
undoDeletion(int index,
Value[] row)
Notifies the adapter that the specified index deletion is being undone |
void |
undoInsert(long row)
|
void |
undoSet(long row,
int field,
Value value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBSpatialDataSourceAdapter(java.lang.String name, java.lang.String alias, DBSpatialSource def, SpatialDBDriver driver)
DriverException
Method Detail |
---|
public java.lang.String getAlias()
DataSource
getAlias
in interface DataSource
public java.lang.String getAsString() throws DriverException
DataSource
getAsString
in interface DataSource
DriverException
public DataSourceFactory getDataSourceFactory()
DataSource
getDataSourceFactory
in interface DataSource
public java.lang.String[] getFieldNames() throws DriverException
DataSource
getFieldNames
in interface DataSource
getFieldNames
in interface PKEditableDataSource
DriverException
- if the access failspublic Memento getMemento() throws MementoException
DataSource
getMemento
in interface DataSource
MementoException
- If the state cannot be obtainedpublic java.lang.String getName()
DataSource
getName
in interface DataSource
public Value[] getRow(long rowIndex) throws DriverException
DataSource
getRow
in interface DataSource
rowIndex
- index of the row to be retrieved
DriverException
- If the access failspublic long[] getWhereFilter() throws java.io.IOException
DataSource
getWhereFilter
in interface DataSource
java.io.IOException
- Si se produce un error accediendo a las estructuras
de datos internaspublic void remove() throws DriverException
DataSource
remove
in interface DataSource
DriverException
- if the DataSource original system could not be
cleaned properlypublic void setAlias(java.lang.String alias)
public void setDataSourceFactory(DataSourceFactory dsf)
DataSource
setDataSourceFactory
in interface DataSource
dsf
- DataSourceFactorypublic void setName(java.lang.String name)
public void execute(java.lang.String sql) throws java.sql.SQLException
execute
in interface PKEditableDataSource
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface PKEditableDataSource
java.sql.SQLException
public Metadata getOriginalMetadata() throws DriverException
EditableDataSource
getOriginalMetadata
in interface EditableDataSource
DriverException
public Value getOriginalFieldValue(long rowIndex, int fieldId) throws DriverException
EditableDataSource
getOriginalFieldValue
in interface EditableDataSource
DriverException
public java.lang.String[] getPKNames() throws DriverException
getPKNames
in interface PKEditableDataSource
DriverException
public long getRowCount() throws DriverException
ReadAccess
getRowCount
in interface ReadAccess
DriverException
- Si se produce algún error accediendo al
DataSourcepublic void saveData(DataSource ds2) throws DriverException
DataSource
saveData
in interface DataSource
ds2
- DataSource with the data
DriverException
- if the operation failspublic void start() throws DriverException
DataSource
start
in interface DataSource
DriverException
- if the operation failspublic void stop() throws DriverException
DataSource
stop
in interface DataSource
DriverException
- If the operation failspublic int getFieldCount() throws DriverException
getFieldCount
in interface EditableDataSource
DriverException
public int getFieldIndexByName(java.lang.String fieldName) throws DriverException
DataSource
getFieldIndexByName
in interface DataSource
fieldName
- Nombre del campo
DriverException
- Si se produce un error accediendo a los datospublic void beginTrans() throws DriverException
DataSource
beginTrans
in interface DataSource
DriverException
- If the transaction could not be startedpublic void commitTrans() throws DriverException, FreeingResourcesException
DataSource
commitTrans
in interface DataSource
DriverException
- If the transaction could not be commited
FreeingResourcesException
- The commit was correctly done but a problem occured
while freeing resourcespublic void deleteRow(long rowId) throws DriverException
SpatialDataSource
deleteRow
in interface SpatialDataSource
rowId
- index of the row to be deleted
DriverException
- if the row could not be deletedpublic Value getFieldValue(long rowIndex, int fieldId) throws DriverException
ReadAccess
getFieldValue
in interface ReadAccess
rowIndex
- filafieldId
- columna
DriverException
- Si se produce un error accediendo al DataSourcepublic void insertEmptyRow() throws DriverException
DataSource
insertEmptyRow
in interface DataSource
DriverException
- if the row could not be insertedpublic void insertEmptyRowAt(long index) throws DriverException
SpatialDataSource
insertEmptyRowAt
in interface SpatialDataSource
index
- index where the row will be inserted. No data is lost.
DriverException
- if the row could not be insertedpublic void insertFilledRow(Value[] values) throws DriverException
DataSource
insertFilledRow
in interface DataSource
values
- Values of the inserted row fields in the field order
DriverException
- if the row could not be insertedpublic void insertFilledRowAt(long index, Value[] values) throws DriverException
SpatialDataSource
insertFilledRowAt
in interface SpatialDataSource
index
- index where the row will be inserted. No data is lost.values
- Values of the inserted row fields in the field order
DriverException
- if the row could not be insertedpublic void rollBackTrans() throws DriverException
DataSource
rollBackTrans
in interface DataSource
DriverException
- If the transaction could not be cancelledpublic void setFieldValue(long row, int fieldId, Value value) throws DriverException
DataSource
setFieldValue
in interface DataSource
row
- row to updatefieldId
- field to updatevalue
- Value to update
DriverException
- If the operation failedpublic void buildIndex() throws DriverException
SpatialDataSource
buildIndex
in interface SpatialDataSource
DriverException
- If the build failspublic void clearIndex() throws DriverException
SpatialDataSource
clearIndex
in interface SpatialDataSource
DriverException
public java.util.List queryIndex(java.awt.geom.Rectangle2D area)
SpatialDataSource
queryIndex
in interface SpatialDataSource
public long getOriginalRowCount() throws DriverException
getOriginalRowCount
in interface PKEditableDataSource
DriverException
public java.lang.String getFieldName(int fieldId) throws DriverException
getFieldName
in interface EditableDataSource
DriverException
public int getFieldType(int i) throws DriverException
getFieldType
in interface EditableDataSource
DriverException
public java.awt.geom.Rectangle2D getFullExtent() throws DriverException
SpatialDataSource
getFullExtent
in interface SpatialDataSource
DriverException
- if the operation failspublic int getGeometryType() throws DriverException
SpatialDataSource
getGeometryType
in interface SpatialDataSource
DriverException
public ValueCollection getPKValue(long rowIndex) throws DriverException
getPKValue
in interface PKEditableDataSource
DriverException
public boolean canRedo()
canRedo
in interface DataSource
public boolean canUndo()
canUndo
in interface DataSource
public void redo() throws DriverException
DataSource
redo
in interface DataSource
DriverException
public void undo() throws DriverException
DataSource
undo
in interface DataSource
DriverException
public boolean isIndexed()
isIndexed
in interface SpatialDataSource
public void addEditionListener(EditionListener listener)
DataSource
addEditionListener
in interface DataSource
public void removeEditionListener(EditionListener listener)
DataSource
removeEditionListener
in interface DataSource
public void setDispatchingMode(int dispatchingMode)
DataSource
setDispatchingMode
in interface DataSource
public int getDispatchingMode()
DataSource
getDispatchingMode
in interface DataSource
public void addField(java.lang.String name, java.lang.String type) throws DriverException
DataSource
addField
in interface DataSource
name
- name of the fieldtype
- driver specific type name
DriverException
public void addField(java.lang.String name, java.lang.String type, java.lang.String[] paramNames, java.lang.String[] paramValues) throws DriverException
DataSource
addField
in interface DataSource
name
- name of the fieldtype
- driver specific type name
DriverException
public void addMetadataEditionListener(MetadataEditionListener listener)
DataSource
addMetadataEditionListener
in interface DataSource
public Metadata getDataSourceMetadata() throws DriverException
DataSource
getDataSourceMetadata
in interface DataSource
DriverException
- If cannot get the DataSource metadatapublic int getOriginalFieldCount() throws DriverException
EditableDataSource
getOriginalFieldCount
in interface EditableDataSource
DriverException
public void removeField(int index) throws DriverException
DataSource
removeField
in interface DataSource
DriverException
public void removeMetadataEditionListener(MetadataEditionListener listener)
DataSource
removeMetadataEditionListener
in interface DataSource
public void setFieldName(int index, java.lang.String name) throws DriverException
DataSource
setFieldName
in interface DataSource
DriverException
public DriverMetadata getDriverMetadata() throws DriverException
DataSource
getDriverMetadata
in interface DataSource
DriverException
public int getType(java.lang.String driverType)
EditableDataSource
getType
in interface EditableDataSource
public DriverMetadata getOriginalDriverMetadata() throws DriverException
EditableDataSource
getOriginalDriverMetadata
in interface EditableDataSource
DriverException
public java.lang.String check(int fieldId, Value value) throws DriverException
DataSource
check
in interface DataSource
DriverException
public int getSpatialFieldIndex() throws DriverException
SpatialDataSource
getSpatialFieldIndex
in interface SpatialDataSource
DriverException
public GDBMSDriver getDriver()
DataSource
getDriver
in interface DataSource
public void endUndoRedoAction()
EditableDataSource
endUndoRedoAction
in interface EditableDataSource
public void startUndoRedoAction()
EditableDataSource
startUndoRedoAction
in interface EditableDataSource
public boolean isModified()
DataSource
isModified
in interface DataSource
public int[] getSelectedRows()
DataSource
getSelectedRows
in interface DataSource
public void setSelectedRows(int[] sel)
DataSource
setSelectedRows
in interface DataSource
public void addSelectionListener(SelectionListener listener)
DataSource
addSelectionListener
in interface DataSource
public void removeSelectionListener(SelectionListener listener)
DataSource
removeSelectionListener
in interface DataSource
public void undoDeletion(int index, Value[] row) throws DriverException
EditableDataSource
undoDeletion
in interface EditableDataSource
DriverException
public void undoSet(long row, int field, Value value) throws DriverException
undoSet
in interface EditableDataSource
DriverException
public void undoInsert(long row) throws DriverException
undoInsert
in interface EditableDataSource
DriverException
public java.awt.geom.Rectangle2D getGeometryBounds(long rowIndex) throws DriverException
SpatialDataSource
getGeometryBounds
in interface SpatialDataSource
DriverException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |