public final class TableMemAccess extends TableAccess
Constructor and Description |
---|
TableMemAccess(MetaData md)
Stores the table in long arrays.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected void |
dirty()
Marks the data structures as dirty.
|
void |
flush(boolean all)
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.
|
replace
public TableMemAccess(MetaData md)
md
- meta datapublic void flush(boolean all)
TableAccess
flush
in class TableAccess
all
- flush all contents or only bufferspublic void close()
TableAccess
close
in class TableAccess
public boolean lock(boolean lock)
TableAccess
lock
in class TableAccess
lock
- write/read lockpublic int read1(int p, int o)
TableAccess
read1
in class TableAccess
p
- pre valueo
- offsetpublic int read2(int p, int o)
TableAccess
read2
in class TableAccess
p
- pre valueo
- offsetpublic int read4(int p, int o)
TableAccess
read4
in class TableAccess
p
- pre valueo
- offsetpublic long read5(int p, int o)
TableAccess
read5
in class TableAccess
p
- pre valueo
- offsetpublic 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 insertprotected void dirty()
TableAccess
dirty
in class TableAccess
Copyright © 2005–2015 BaseX Team. All rights reserved.