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

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

public class FixedMemoryIndexSet
extends MemoryIndexSet
implements FixedIndexSet

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
FixedMemoryIndexSet(int initialCapacity)
          Creates a new MemoryIndexSet object.
 
Method Summary
 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 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

FixedMemoryIndexSet

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

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)

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()


Copyright © 2005-2006 . All Rights Reserved.