|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.io.random.TableAccess
org.basex.io.random.TableMemAccess
public final class TableMemAccess
This class allows main memory access to the database table representation. NOTE: this class is not thread-safe.
Field Summary |
---|
Fields inherited from class org.basex.io.random.TableAccess |
---|
dirty, meta |
Constructor Summary | |
---|---|
TableMemAccess(MetaData md)
Stores the table in long arrays. |
Method Summary | |
---|---|
void |
close()
Closes the table access. |
protected void |
copy(byte[] entries,
int pre,
int last)
Copies the specified values into the database. |
void |
delete(int pre,
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. |
boolean |
lock(boolean lock)
Tries to acquires a lock on the table. |
int |
read1(int p,
int o)
Reads a byte value and returns it as an integer value. |
int |
read2(int p,
int o)
Reads a short value and returns it as an integer value. |
int |
read4(int p,
int o)
Reads an integer value. |
long |
read5(int p,
int o)
Reads a 5-byte value and returns it as a long value. |
void |
write1(int p,
int o,
int v)
Writes a byte value to the specified position. |
void |
write2(int p,
int o,
int v)
Writes a short value to the specified position. |
void |
write4(int p,
int o,
int v)
Writes an integer value to the specified position. |
void |
write5(int p,
int o,
long v)
Writes a 5-byte value to the specified position. |
Methods inherited from class org.basex.io.random.TableAccess |
---|
replace, set |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableMemAccess(MetaData md)
md
- meta dataMethod Detail |
---|
public void flush()
TableAccess
flush
in class TableAccess
public void close() throws java.io.IOException
TableAccess
close
in class TableAccess
java.io.IOException
- I/O exceptionpublic boolean lock(boolean lock)
TableAccess
lock
in class TableAccess
lock
- exclusive/shared lock
public int read1(int p, int o)
TableAccess
read1
in class TableAccess
p
- pre valueo
- offset
public int read2(int p, int o)
TableAccess
read2
in class TableAccess
p
- pre valueo
- offset
public int read4(int p, int o)
TableAccess
read4
in class TableAccess
p
- pre valueo
- offset
public long read5(int p, int o)
TableAccess
read5
in class TableAccess
p
- pre valueo
- offset
public void write1(int p, int o, int v)
TableAccess
write1
in class TableAccess
p
- pre valueo
- offsetv
- value to be writtenpublic void write2(int p, int o, int v)
TableAccess
write2
in class TableAccess
p
- pre valueo
- offsetv
- value to be writtenpublic void write4(int p, int o, int v)
TableAccess
write4
in class TableAccess
p
- pre valueo
- offsetv
- value to be writtenpublic void write5(int p, int o, long v)
TableAccess
write5
in class TableAccess
p
- pre valueo
- offsetv
- value to be writtenprotected void copy(byte[] entries, int pre, int last)
TableAccess
copy
in class TableAccess
entries
- entries to copypre
- first target pre valuelast
- last pre valuepublic void delete(int pre, int nr)
TableAccess
delete
in class TableAccess
pre
- pre value of the first node to deletenr
- number of entries to be deletedpublic void insert(int pre, byte[] entries)
TableAccess
insert
in class TableAccess
pre
- pre valueentries
- array of bytes containing the entries to insert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |