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

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

public class VariableMemoryIndexSet
extends MemoryIndexSet
implements VariableIndexSet

Implementación de un conjunto de índices en memoria, aunque puede haber un conjunto de Long.MAXVALUE índices, en memoria, el tamaño máximo es de Integer.MAXVALUE. Otras implementaciones de VariableIndexSet en memoria pueden no tener esta restricción

Author:
Fernando González Cortés

Field Summary
 
Fields inherited from class com.hardcode.gdbms.engine.data.indexes.MemoryIndexSet
indexes
 
Constructor Summary
VariableMemoryIndexSet(int initialCapacity)
          Creates a new MemoryIndexSet object.
 
Method Summary
 void addIndex(long index)
          Añade un índice al conjunto de índices
 long getIndexCount()
          Devuelve el número de índices si se invocó previamente a indexSetComplete y lanza una excepción en caso contrario
 long[] getIndexes()
          Obtiene los índices del conjunto de índices en un array
 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 com.hardcode.gdbms.engine.data.indexes.MemoryIndexSet
close, getIndex
 
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.indexes.BaseIndexSet
close, getIndex
 

Constructor Detail

VariableMemoryIndexSet

public VariableMemoryIndexSet(int initialCapacity)
Creates a new MemoryIndexSet object.

Parameters:
initialCapacity - Capacidad inicial del conjunto de índices. Deberá de ser la capacidad máxima que pueda llegar a tener el conjunto
Method Detail

open

public void open()
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
See Also:
com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#open(java.io.File)

indexSetComplete

public void indexSetComplete()
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
See Also:
VariableIndexSet.indexSetComplete()

addIndex

public void addIndex(long index)
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
See Also:
VariableIndexSet.addIndex(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:
com.hardcode.gdbms.engine.data.indexes.VariableIndexSet#getIndexCount(long)

getIndexes

public long[] getIndexes()
Description copied from interface: VariableIndexSet
Obtiene los índices del conjunto de índices en un array

Specified by:
getIndexes in interface VariableIndexSet
Returns:
long[]
See Also:
VariableIndexSet.getIndexes()


Copyright © 2005-2006 . All Rights Reserved.