/** * Returns the value of the indicated slot */ FreePhysicalRowId get( int slot ) { if ( slots[slot] == null ) { slots[slot] = new FreePhysicalRowId( blockIo, slotToOffset( slot ) ) ; } return slots[slot]; }
/** Returns true if a slot is allocated */ boolean isAllocated( int slot ) { return get( slot ).getSize() != 0; }
/** * Frees a slot */ void free( int slot ) { get( slot ).setSize( 0 ); setCount( ( short ) ( getCount() - 1 ) ); }
/** Frees a slot */ void free( int slot ) { get( slot ).setSize( 0 ); setCount( ( short ) ( getCount() - 1 ) ); }
/** * Returns true if a slot is allocated */ boolean isAllocated( int slot ) { return get( slot ).getSize() != 0; }
/** Returns the value of the indicated slot */ FreePhysicalRowId get( int slot ) { if ( slots[slot] == null ) { slots[slot] = new FreePhysicalRowId( block, slotToOffset( slot ) ) ; } return slots[slot]; }
/** Frees a slot */ void free( int slot ) { get( slot ).setSize( 0 ); setCount( ( short ) ( getCount() - 1 ) ); }
/** Returns true if a slot is allocated */ boolean isAllocated( int slot ) { return get( slot ).getSize() != 0; }
/** Returns the value of the indicated slot */ FreePhysicalRowId get( int slot ) { if ( slots[slot] == null ) { slots[slot] = new FreePhysicalRowId( block, slotToOffset( slot ) ) ; } return slots[slot]; }
/** * @return first slot with available size >= indicated size, or -1 if no * slots are available. */ int getFirstLargerThan( int size ) { for ( int i = 0; i < ELEMS_PER_PAGE; i++ ) { if ( isAllocated( i ) && get( i ).getSize() >= size ) { return i; } } return -1; }
/** * Returns first slot with available size >= indicated size, or -1 if no * slots are available. */ int getFirstLargerThan( int size ) { for ( int i = 0; i < ELEMS_PER_PAGE; i++ ) { if ( isAllocated( i ) && get( i ).getSize() >= size ) { return i; } } return -1; } }
/** * Returns first slot with available size >= indicated size, or -1 if no * slots are available. */ int getFirstLargerThan( int size ) { for ( int i = 0; i < ELEMS_PER_PAGE; i++ ) { if ( isAllocated( i ) && get( i ).getSize() >= size ) { return i; } } return -1; } }