class FreeListBlock extends Object
Magic number (long) next freelist block page (unsigned int) size (unsigned int) that many free pages (unsigned ints)Always fits on one page. Free page format:
Magic number (long)
Modifier and Type | Field and Description |
---|---|
int |
page |
Constructor and Description |
---|
FreeListBlock(RandomAccessInterface file,
int startPage) |
Modifier and Type | Method and Description |
---|---|
void |
addPage(int freePage)
Adds free page and writes new len to disk
|
boolean |
flbck(boolean fix)
Recursive.
|
int |
getNextPage() |
static void |
initPage(RandomAccessInterface file,
int page) |
boolean |
isEmpty() |
boolean |
isFull() |
void |
setNextPage(int nxt)
Set and write the next page only
|
int |
takePage()
Takes next page and writes new len to disk
|
String |
toString() |
void |
writeBlock() |
public FreeListBlock(RandomAccessInterface file, int startPage) throws IOException
IOException
public void writeBlock() throws IOException
IOException
public int getNextPage()
public void setNextPage(int nxt) throws IOException
IOException
public boolean isEmpty()
public boolean isFull()
public void addPage(int freePage) throws IOException
IllegalStateException
- if fullIOException
public int takePage() throws IOException
IllegalStateException
- if emptyIOException
public static void initPage(RandomAccessInterface file, int page) throws IOException
IOException
public boolean flbck(boolean fix) throws IOException
IOException