com.hardcode.gdbms.engine.strategies
Class OrderedDataSource

java.lang.Object
  extended by com.hardcode.gdbms.engine.strategies.OperationDataSource
      extended by com.hardcode.gdbms.engine.strategies.OrderedDataSource
All Implemented Interfaces:
DataSource, ReadAccess

public class OrderedDataSource
extends OperationDataSource
implements DataSource

DOCUMENT ME!

Author:
Fernando González Cortés

Nested Class Summary
 class OrderedDataSource.SortComparator
          DOCUMENT ME!
 
Field Summary
 
Fields inherited from interface com.hardcode.gdbms.engine.data.DataSource
COHERENT_ROW_ORDER, DIRECT_MODE, DISPATCH, IGNORE, STORE
 
Constructor Summary
OrderedDataSource(OperationDataSource ret, java.lang.String[] fieldNames, int[] types)
          DOCUMENT ME!
 
Method Summary
 Metadata getDataSourceMetadata()
          Gets the meta data about the source of this DataSource
 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
 Value getFieldValue(long rowIndex, int fieldId)
          Obtiene el valor que se encuentra en la fila y columna indicada
 Memento getMemento()
          Gets a memento object with the current status of the DataSource
 long getRowCount()
          Obtiene el número de registros del DataSource
 long[] getWhereFilter()
          Devuelve el filtro que resultó de la cláusula where de la instrucción que dió como resultado este DataSource.
 void order()
           
 void start()
          Opens the DataSource to access the data it contains.
 void stop()
          Closes the DataSource.
 
Methods inherited from class com.hardcode.gdbms.engine.strategies.OperationDataSource
addEditionListener, addField, addField, addMetadataEditionListener, addSelectionListener, beginTrans, canRedo, canUndo, check, commitTrans, deleteRow, getAlias, getAsString, getDataSourceFactory, getDispatchingMode, getDriver, getDriverMetadata, getFieldNames, getName, getRow, getSelectedRows, getSQL, insertEmptyRow, insertEmptyRowAt, insertFilledRow, insertFilledRowAt, isModified, redo, remove, removeEditionListener, removeField, removeMetadataEditionListener, removeSelectionListener, rollBackTrans, saveData, setAlias, setDataSourceFactory, setDispatchingMode, setFieldName, setFieldValue, setName, setSelectedRows, setSQL, 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, getDispatchingMode, getDriver, getDriverMetadata, getFieldNames, getName, getRow, getSelectedRows, insertEmptyRow, insertFilledRow, isModified, redo, remove, removeEditionListener, removeField, removeMetadataEditionListener, removeSelectionListener, rollBackTrans, saveData, setDataSourceFactory, setDispatchingMode, setFieldName, setFieldValue, setSelectedRows, undo
 

Constructor Detail

OrderedDataSource

public OrderedDataSource(OperationDataSource ret,
                         java.lang.String[] fieldNames,
                         int[] types)
                  throws DriverException
DOCUMENT ME!

Parameters:
ret -
fieldNames -
types -
Throws:
DriverException
Method Detail

start

public void start()
           throws DriverException
Description copied from interface: DataSource
Opens the DataSource to access the data it contains. If the data is accessed without a previous opening a ClosedDataSourceException is thrown. If this method is invoked twice then only the second call to stop will close the DataSource.
If the DataSource was obtained with an AUTOMATIC_OPENING mode, there's no need to open the DataSource. Indeed start calls are ignored. It's possible to close the DataSource by a single call to the close method

Specified by:
start in interface DataSource
Throws:
DriverException - if the operation fails
See Also:
DataSource.start()

stop

public void stop()
          throws DriverException
Description copied from interface: DataSource
Closes the DataSource. After a DataSource is closed it's data cannot be retrieved. Any attempt to do so will result in a DataSourceClosedException

Specified by:
stop in interface DataSource
Throws:
DriverException - If the operation fails
See Also:
DataSource.stop()

getMemento

public Memento getMemento()
                   throws MementoException
Description copied from interface: DataSource
Gets a memento object with the current status of the DataSource

Specified by:
getMemento in interface DataSource
Overrides:
getMemento in class OperationDataSource
Returns:
DataSourceMemento
Throws:
MementoException - If the state cannot be obtained
See Also:
DataSource.getMemento()

getFieldIndexByName

public int getFieldIndexByName(java.lang.String fieldName)
                        throws DriverException
Description copied from interface: DataSource
Obtiene el indice de un campo a partir de su nombre o -1 si no existe un campo con ese nombre

Specified by:
getFieldIndexByName in interface DataSource
Overrides:
getFieldIndexByName in class OperationDataSource
Parameters:
fieldName - Nombre del campo
Returns:
Indice del campo con el nombre dado o -1 si el campo no existe
Throws:
DriverException - Si se produce un error accediendo a los datos
See Also:
DataSource.getFieldIndexByName(java.lang.String)

getFieldValue

public Value getFieldValue(long rowIndex,
                           int fieldId)
                    throws DriverException
Description copied from interface: ReadAccess
Obtiene el valor que se encuentra en la fila y columna indicada

Specified by:
getFieldValue in interface ReadAccess
Parameters:
rowIndex - fila
fieldId - columna
Returns:
subclase de Value con el valor del origen de datos. Never null (use ValueFactory.createNullValue() instead)
Throws:
DriverException - Si se produce un error accediendo al DataSource
See Also:
ReadAccess.getFieldValue(long, int)

getRowCount

public long getRowCount()
                 throws DriverException
Description copied from interface: ReadAccess
Obtiene el número de registros del DataSource

Specified by:
getRowCount in interface ReadAccess
Returns:
Throws:
DriverException - Si se produce algún error accediendo al DataSource
See Also:
ReadAccess.getRowCount()

order

public void order()
           throws DriverException
Throws:
DriverException

getWhereFilter

public long[] getWhereFilter()
                      throws java.io.IOException
Description copied from interface: DataSource
Devuelve el filtro que resultó de la cláusula where de la instrucción que dió como resultado este DataSource.

Specified by:
getWhereFilter in interface DataSource
Overrides:
getWhereFilter in class OperationDataSource
Returns:
Filtro de la cláusula where o null si el DataSource no es resultado de una instrucción con cláusula where
Throws:
java.io.IOException - Si se produce un error accediendo a las estructuras de datos internas
See Also:
DataSource.getWhereFilter()

getDataSourceMetadata

public Metadata getDataSourceMetadata()
                               throws DriverException
Description copied from interface: DataSource
Gets the meta data about the source of this DataSource

Specified by:
getDataSourceMetadata in interface DataSource
Returns:
DataSourceMetadata
Throws:
DriverException - If cannot get the DataSource metadata


Copyright © 2005-2006 . All Rights Reserved.