Package org.basex.index.resource
Class Resources
java.lang.Object
org.basex.index.resource.Resources
- All Implemented Interfaces:
Index
This index organizes the resources of a database (XML documents and raw files).
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the database paths to all binary files that start with the specified path.children(byte[] path, boolean dir) Returns the child resources for the given path.voidclose()Closes the index.costs(IndexSearch search) Computes costs for performing the specified search.voiddelete(int pre, int size) Deletes the specified entry and updates subsequent nodes.intReturns the pre value of the document node that matches the specified path, or-1.docs()Returns theprevalues of all document nodes.Returns the pre values of all document nodes that start with the specified path.Returns the pre values of all document nodes that start with the specified path.booleandrop()Drops the index.entries(IndexEntries entries) Returns all entries that match the specified token.byte[]info(MainOptions options) Returns information on the index structure.voidAdds entries to the index and updates subsequent nodes.booleanisDir(byte[] path) Determines whether the given path is the path to a directory.iter(IndexSearch search) Returns an iterator for the index results.voidReads information on database resources from disk.voidrename(int pre, byte[] value) Updates the index after a document has been renamed.voidwrite(DataOutput out) Writes information on database resources to disk.
-
Constructor Details
-
Resources
Constructor.- Parameters:
data- data reference
-
-
Method Details
-
read
Reads information on database resources from disk.- Parameters:
in- input stream- Throws:
IOException- I/O exception
-
write
Writes information on database resources to disk.- Parameters:
out- output stream- Throws:
IOException- I/O exception
-
docs
Returns theprevalues of all document nodes.- Returns:
- document nodes (internal representation!)
-
insert
Adds entries to the index and updates subsequent nodes.- Parameters:
pre- insertion positionclip- data clip
-
delete
public void delete(int pre, int size) Deletes the specified entry and updates subsequent nodes.- Parameters:
pre- pre valuesize- number of deleted nodes
-
rename
public void rename(int pre, byte[] value) Updates the index after a document has been renamed.- Parameters:
pre- pre value of updated documentvalue- new name
-
docs
Returns the pre values of all document nodes that start with the specified path.- Parameters:
path- input path- Returns:
- pre values (internal representation!)
-
docs
Returns the pre values of all document nodes that start with the specified path.- Parameters:
path- input pathdesc- descendant traversal- Returns:
- pre values (internal representation!)
-
doc
Returns the pre value of the document node that matches the specified path, or-1.- Parameters:
path- input path- Returns:
- pre value, or
-1
-
binaries
Returns the database paths to all binary files that start with the specified path.- Parameters:
path- input path- Returns:
- root nodes
-
isDir
public boolean isDir(byte[] path) Determines whether the given path is the path to a directory.- Parameters:
path- given path- Returns:
- result of check
-
children
Returns the child resources for the given path.- Parameters:
path- pathdir- returns directories- Returns:
- paths; values of documents will be
false
-
drop
public boolean drop()Description copied from interface:IndexDrops the index. Also returns true if the index does not exist. -
close
public void close()Description copied from interface:IndexCloses the index. -
iter
Description copied from interface:IndexReturns an iterator for the index results. -
costs
Description copied from interface:IndexComputes costs for performing the specified search. An integer is returned:- A negative value indicates that index access is not possible.
- A value of zero indicates that no results will be returned.
- A small value indicates that index access is fast.
-
info
Description copied from interface:IndexReturns information on the index structure. -
entries
Description copied from interface:IndexReturns all entries that match the specified token.
-