|
||||||||||
| 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.
| Field Summary | |
|---|---|
RandomAccessFile |
data
File storing all blocks. |
| Constructor Summary | |
|---|---|
TableDiskAccess(MetaData md,
String pf)
Constructor. |
|
| Method Summary | |
|---|---|
int |
blocks()
Returns the number of used blocks; needed for JUnit tests. |
void |
close()
Closes the table access. |
void |
delete(int first,
int nr)
Deletes the specified number of entries from the database. |
void |
flush()
Flushes the table contents. |
void |
insert(int pre,
byte[] entries)
Inserts the specified entries into the database. |
int |
read1(int pre,
int off)
Reads a byte value and returns it as an integer value. |
int |
read2(int pre,
int off)
Reads a short value and returns it as an integer value. |
int |
read4(int pre,
int off)
Reads an integer value. |
long |
read5(int pre,
int off)
Reads a 5-byte value and returns it as a long value. |
void |
set(int pre,
byte[] entries)
Copies the specified entry into the database. |
int |
size()
Returns the number of entries; needed for JUnit tests. |
void |
write1(int pre,
int off,
int v)
Writes a byte value to the specified position. |
void |
write2(int pre,
int off,
int v)
Writes a short value to the specified position. |
void |
write4(int pre,
int off,
int v)
Writes an integer value to the specified position. |
void |
write5(int pre,
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 |
| Field Detail |
|---|
public final RandomAccessFile data
| Constructor Detail |
|---|
public TableDiskAccess(MetaData md,
String pf)
throws IOException
md - meta datapf - file prefix
IOException - I/O exception| Method Detail |
|---|
public void flush()
throws IOException
TableAccess
flush in class TableAccessIOException - I/O exception
public void close()
throws IOException
TableAccess
close in class TableAccessIOException - I/O exception
public int read1(int pre,
int off)
TableAccess
read1 in class TableAccesspre - pre valueoff - offset
public int read2(int pre,
int off)
TableAccess
read2 in class TableAccesspre - pre valueoff - offset
public int read4(int pre,
int off)
TableAccess
read4 in class TableAccesspre - pre valueoff - offset
public long read5(int pre,
int off)
TableAccess
read5 in class TableAccesspre - pre valueoff - offset
public void write1(int pre,
int off,
int v)
TableAccess
write1 in class TableAccesspre - pre valueoff - offsetv - value to be written
public void write2(int pre,
int off,
int v)
TableAccess
write2 in class TableAccesspre - pre valueoff - offsetv - value to be written
public void write4(int pre,
int off,
int v)
TableAccess
write4 in class TableAccesspre - pre valueoff - offsetv - value to be written
public void write5(int pre,
int off,
long v)
TableAccess
write5 in class TableAccesspre - 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 valueentries - array of bytes containing the entries to insert
public void set(int pre,
byte[] entries)
TableAccess
set in class TableAccesspre - pre valueentries - 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 | |||||||||