|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.basex.io.TableAccess
org.basex.io.TableDiskAccess
public final class TableDiskAccess
This class stores the table on disk and reads it block-wise.
| Constructor Summary | |
|---|---|
TableDiskAccess(java.lang.String nm,
java.lang.String f)
Constructor. |
|
| Method Summary | |
|---|---|
int |
blocks()
Return the number of used blocks; needed for JUnit tests. |
void |
close()
Closes the table access. |
void |
delete(int first,
int nr)
Delete a range of entries. |
void |
flush()
Flushes the table contents. |
void |
insert(int pre,
byte[] entries)
Insert entries. |
int |
read1(int pos,
int off)
Reads a byte from the specified position and returns it as integer. |
int |
read2(int pos,
int off)
Reads a short value from the specified position and returns it as integer. |
int |
read4(int pos,
int off)
Reads an integer value from the specified position. |
long |
read5(int pos,
int off)
Reads an integer value from the specified position. |
int |
size()
Return the entryCount; needed for JUnit tests. |
void |
write1(int pos,
int off,
int v)
Writes a byte to the specified position. |
void |
write2(int pos,
int off,
int v)
Writes 2 bytes to the specified position. |
void |
write4(int pos,
int off,
int v)
Writes an integer value to the specified position. |
void |
write5(int pos,
int off,
long v)
Writes a 5-byte value to the specified position. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TableDiskAccess(java.lang.String nm,
java.lang.String f)
throws java.io.IOException
nm - name of the databasef - prefix for all files (no ending)
java.io.IOException - in case files cannot be read| Method Detail |
|---|
public void flush()
throws java.io.IOException
TableAccess
flush in class TableAccessjava.io.IOException - in case of write errors
public void close()
throws java.io.IOException
TableAccess
close in class TableAccessjava.io.IOException - in case of write errors
public int read1(int pos,
int off)
TableAccess
read1 in class TableAccesspos - pre valueoff - offset
public int read2(int pos,
int off)
TableAccess
read2 in class TableAccesspos - pre valueoff - offset
public int read4(int pos,
int off)
TableAccess
read4 in class TableAccesspos - pre valueoff - offset
public long read5(int pos,
int off)
TableAccess
read5 in class TableAccesspos - pre valueoff - offset
public void write1(int pos,
int off,
int v)
TableAccess
write1 in class TableAccesspos - pre valueoff - offsetv - value to be written
public void write2(int pos,
int off,
int v)
TableAccess
write2 in class TableAccesspos - pre valueoff - offsetv - value to be written
public void write4(int pos,
int off,
int v)
TableAccess
write4 in class TableAccesspos - pre valueoff - offsetv - value to be written
public void write5(int pos,
int off,
long v)
TableAccess
write5 in class TableAccesspos - pre valueoff - offsetv - value to be written
public void delete(int first,
int nr)
TableAccess
delete in class TableAccessfirst - pre value of the first node to deletenr - number of entries to be deleted
public void insert(int pre,
byte[] entries)
TableAccess
insert in class TableAccesspre - pre value of node to insert afterentries - array of bytes containing the entries to insertpublic int size()
public int blocks()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||