/** * Returns the value of the indicated slot */ PhysicalRowId get( int slot ) { if ( slots[slot] == null ) { slots[slot] = new PhysicalRowId( blockIo, slotToOffset( slot ) ); } return slots[slot]; }
/** Returns the value of the indicated slot */ PhysicalRowId get(int slot) { if (slots[slot] == null) slots[slot] = new PhysicalRowId(block, slotToOffset(slot)); return slots[slot]; }
/** Returns the value of the indicated slot */ PhysicalRowId get(int slot) { if (slots[slot] == null) slots[slot] = new PhysicalRowId(block, slotToOffset(slot));; return slots[slot]; }
/** Returns true if a slot is allocated */ boolean isAllocated(int slot) { //return get(slot).getBlock() > 0; return getLocationBlock(slotToOffset(slot)) > 0; }
/** Frees a slot */ void free(int slot) { setLocationBlock(slotToOffset(slot), 0); //get(slot).setBlock(0); setCount((short) (getCount() - 1)); // update previousFoundFree if the freed slot is before what we've found in the past if (slot < previousFoundFree) previousFoundFree = slot; }
/** Allocates a slot */ short alloc(int slot) { setCount((short) (getCount() + 1)); short pos = slotToOffset(slot); setLocationBlock(pos, -1); //get(slot).setBlock(-1); // update previousFoundAllocated if the newly allocated slot is before what we've found in the past if (slot < previousFoundAllocated) previousFoundAllocated = slot; return pos; }
public long slotToLocation(int slot) { short pos = slotToOffset(slot); return Location.toLong(getLocationBlock(pos),getLocationOffset(pos)); }