/** Returns true if a slot is free */ boolean isFree(int slot) { return !isAllocated(slot); }
/** * Returns first allocated slot, -1 if no slots are available. */ int getFirstAllocated() { for (int i = 0; i < ELEMS_PER_PAGE; i++) { if (isAllocated(i)) return i; } return -1; } }
/** Returns true if a slot is free */ boolean isFree(int slot) { return !isAllocated(slot); }
/** Returns true if a slot is free */ boolean isFree(int slot) { return !isAllocated(slot); }
/** * Returns first allocated slot, -1 if no slots are available. */ int getFirstAllocated() { for (int i = 0; i < ELEMS_PER_PAGE; i++) { if (isAllocated(i)) return i; } return -1; } }
/** * Returns first allocated slot, -1 if no slots are available. */ int getFirstAllocated() { for (; previousFoundAllocated < ELEMS_PER_PAGE; previousFoundAllocated++) { if (isAllocated(previousFoundAllocated)) return previousFoundAllocated; } return -1; }
/** * Returns true if a slot is free */ private boolean isFree( int slot ) { return !isAllocated(slot); }
/** * @return The first allocated slot, -1 if no slots are available. */ int getFirstAllocated() { for ( int i = 0; i < ELEMS_PER_PAGE; i++ ) { if ( isAllocated( i ) ) { return i; } } return -1; }