Constructor and Description |
---|
MemData(Data data,
MainOptions options)
Light-weight constructor, adopting data structures from the specified database.
|
MemData(MainOptions opts)
Constructor, creating a new, empty database.
|
MemData(PathSummary paths,
Namespaces nspaces,
MainOptions opts)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the database.
|
void |
createIndex(IndexType type,
MainOptions options,
Command cmd)
Drops the specified index.
|
protected void |
delete(int pre,
boolean text)
Deletes the specified text entry.
|
boolean |
dropIndex(IndexType type)
Drops the specified index.
|
void |
finish()
Finishes the build process.
|
void |
finishUpdate(MainOptions opts)
Finishes an update operation: removes the update file and the exclusive lock.
|
void |
flush(boolean all)
Flushes updated data.
|
protected long |
index(int pre,
int id,
byte[] txt,
int kind)
Indexes a text and returns the reference.
|
protected void |
indexDelete(int pre,
int size)
Delete a node and its descendants from the corresponding indexes.
|
boolean |
inMemory()
Indicates if this data instance is in main memory or on disk.
|
void |
startUpdate(MainOptions opts)
Starts an update operation: writes a file to disk to indicate that an update is
going on, and exclusively locks the table file.
|
byte[] |
text(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value.
|
double |
textDbl(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as double value.
|
long |
textItr(int pre,
boolean text)
Returns a text (text, comment, pi) or attribute value as integer value.
|
int |
textLen(int pre,
boolean text)
Returns the byte length of a (possibly compressed) text (text, comment, pi).
|
void |
updateText(int pre,
byte[] value,
int kind)
Updates the specified text or attribute value.
|
public MemData(PathSummary paths, Namespaces nspaces, MainOptions opts)
paths
- path summarynspaces
- namespacesopts
- database optionspublic MemData(Data data, MainOptions options)
data
- data referenceoptions
- main optionspublic MemData(MainOptions opts)
opts
- database optionspublic void finish()
public void close()
Data
public void createIndex(IndexType type, MainOptions options, Command cmd)
Data
createIndex
in class Data
type
- index to be droppedoptions
- main optionscmd
- calling commandpublic boolean dropIndex(IndexType type)
Data
public void startUpdate(MainOptions opts)
Data
startUpdate
in class Data
opts
- main optionspublic void finishUpdate(MainOptions opts)
Data
finishUpdate
in class Data
opts
- main optionspublic void flush(boolean all)
Data
public byte[] text(int pre, boolean text)
Data
public long textItr(int pre, boolean text)
Data
Long.MIN_VALUE
is returned if the input is no valid integer.public double textDbl(int pre, boolean text)
Data
Double.NaN
is returned if the input is no valid double.public int textLen(int pre, boolean text)
Data
protected void delete(int pre, boolean text)
Data
public void updateText(int pre, byte[] value, int kind)
Data
updateText
in class Data
pre
- pre valuevalue
- contentkind
- node kindprotected long index(int pre, int id, byte[] txt, int kind)
Data
protected void indexDelete(int pre, int size)
Data
indexDelete
in class Data
pre
- pre value of the node to deletesize
- number of descendantsCopyright © 2005–2015 BaseX Team. All rights reserved.