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 | Description |
|---|---|---|
int |
page |
| Constructor | Description |
|---|---|
FreeListBlock(RandomAccessInterface file,
int startPage) |
| Modifier and Type | Method | 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
IOExceptionpublic void writeBlock()
throws IOException
IOExceptionpublic int getNextPage()
public void setNextPage(int nxt)
throws IOException
IOExceptionpublic boolean isEmpty()
public boolean isFull()
public void addPage(int freePage)
throws IOException
IllegalStateException - if fullIOExceptionpublic int takePage()
throws IOException
IllegalStateException - if emptyIOExceptionpublic static void initPage(RandomAccessInterface file, int page) throws IOException
IOExceptionpublic boolean flbck(boolean fix)
throws IOException
IOException