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

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

public class FixedDiskIndexSet
extends DiskIndexSet
implements FixedIndexSet

Implementación de FixedIndexSet 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
FixedDiskIndexSet(long size)
          Crea un nuevo FixedDiskIndexSet.
 
Method Summary
 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
 void open(java.io.File f)
          Abre el almacenamiento del índice para la escritura de los índices
 void setIndex(long index, long value)
          establece el índice 'index'-ésimo para que apunte a la fila 'value'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedDiskIndexSet

public FixedDiskIndexSet(long size)
Crea un nuevo FixedDiskIndexSet.

Parameters:
size - DOCUMENT ME!
Method Detail

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(java.io.File f)
          throws java.io.IOException
Description copied from interface: FixedIndexSet
Abre el almacenamiento del índice para la escritura de los índices

Specified by:
open in interface FixedIndexSet
Parameters:
f - fichero en el que se guardará el índice
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()

setIndex

public void setIndex(long index,
                     long value)
              throws java.io.IOException
Description copied from interface: FixedIndexSet
establece el índice 'index'-ésimo para que apunte a la fila 'value'

Specified by:
setIndex in interface FixedIndexSet
Parameters:
index - índice que se quiere cambiar
value - índice de la fila a la que apunta este índice
Throws:
java.io.IOException - Si se produce un fallo al escribir el índice
See Also:
FixedIndexSet.setIndex(long, long)


Copyright © 2005-2006 . All Rights Reserved.