com.hardcode.gdbms.engine.data.indexes
Class VariableDiskIndexSet

java.lang.Object
  extended by com.hardcode.gdbms.engine.data.indexes.DiskIndexSet
      extended by com.hardcode.gdbms.engine.data.indexes.VariableDiskIndexSet
All Implemented Interfaces:
BaseIndexSet, VariableIndexSet

public class VariableDiskIndexSet
extends DiskIndexSet
implements VariableIndexSet

Implementación de VariableIndexSet que escribe los índices en un fichero

Author:
Fernando González Cortés

Field Summary
 
Fields inherited from class com.hardcode.gdbms.engine.data.indexes.DiskIndexSet
buffer, file, fis, fos, inputChannel, outputChannel, writeBuffer
 
Constructor Summary
VariableDiskIndexSet()
           
 
Method Summary
 void addAll(VariableIndexSet initialSet)
          Añade todos los índices que se pasan como parámetro
 void addIndex(long index)
          Añade un índice al conjunto de índices
 void close()
          Cierra el fichero de índices
 long getIndex(long nth)
          Devuelve el índice nth-ésimo si se invocó previamente a indexSetComplete y lanza una excepción en caso contrario
 long getIndexCount()
          Devuelve el número de índices si se invocó previamente a indexSetComplete y lanza una excepción en caso contrario
 long[] getIndexes()
          DOCUMENT ME!
 void indexSetComplete()
          Cierra el conjunto de índices para el almacenamiento, a partir de una llamada a este método no se puede escribir ningún índice más, sólamente se pueden leer
 void open()
          Abre el almacenamiento del índice para la escritura de los índices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableDiskIndexSet

public VariableDiskIndexSet()
Method Detail

addAll

public void addAll(VariableIndexSet initialSet)
            throws java.io.IOException
Añade todos los índices que se pasan como parámetro

Parameters:
initialSet - Conjunto de índices que se quieren añadir
Throws:
java.io.IOException - Si se produce un fallo al añadir los índices

addIndex

public void addIndex(long index)
              throws java.io.IOException
Description copied from interface: VariableIndexSet
Añade un índice al conjunto de índices

Specified by:
addIndex in interface VariableIndexSet
Parameters:
index - índice de la fila a la que apunta el índice que se quiere añadir
Throws:
java.io.IOException - Si se produce un fallo al escribir el índice
See Also:
VariableIndexSet.addIndex(long)

getIndex

public long getIndex(long nth)
              throws java.io.IOException
Description copied from interface: BaseIndexSet
Devuelve el índice nth-ésimo si se invocó previamente a indexSetComplete y lanza una excepción en caso contrario

Specified by:
getIndex in interface BaseIndexSet
Parameters:
nth - índice del índice que se quiere obtener
Returns:
indice nth-ésimo
Throws:
java.io.IOException - Si se produce un fallo al recuperar el índice
See Also:
BaseIndexSet.getIndex(long)

getIndexCount

public long getIndexCount()
Description copied from interface: BaseIndexSet
Devuelve el número de índices si se invocó previamente a indexSetComplete y lanza una excepción en caso contrario

Specified by:
getIndexCount in interface BaseIndexSet
Returns:
Si se produce un fallo al obtener el número de índices
See Also:
BaseIndexSet.getIndexCount()

open

public void open()
          throws java.io.IOException
Description copied from interface: VariableIndexSet
Abre el almacenamiento del índice para la escritura de los índices. En caso de un almacenamiento permanente se usará un fichero temporal

Specified by:
open in interface VariableIndexSet
Throws:
java.io.IOException - Si se produce un fallo al abrir
See Also:
com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#open(java.io.File)

close

public void close()
           throws java.io.IOException
Description copied from interface: BaseIndexSet
Cierra el fichero de índices

Specified by:
close in interface BaseIndexSet
Throws:
java.io.IOException - Si se produce un fallo al cerrar
See Also:
BaseIndexSet.close()

indexSetComplete

public void indexSetComplete()
                      throws java.io.IOException
Description copied from interface: VariableIndexSet
Cierra el conjunto de índices para el almacenamiento, a partir de una llamada a este método no se puede escribir ningún índice más, sólamente se pueden leer

Specified by:
indexSetComplete in interface VariableIndexSet
Throws:
java.io.IOException - Si se produce un fallo al cerrar los streams de salida
See Also:
VariableIndexSet.indexSetComplete()

getIndexes

public long[] getIndexes()
                  throws java.io.IOException
DOCUMENT ME!

Specified by:
getIndexes in interface VariableIndexSet
Returns:
DOCUMENT ME!
Throws:
java.io.IOException
See Also:
VariableIndexSet.getIndexes()


Copyright © 2005-2006 . All Rights Reserved.