|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.index.path.PathSummary
public final class PathSummary
This class stores the path summary of a database. It contains all unique location paths.
Constructor Summary | |
---|---|
PathSummary()
Constructor. |
|
PathSummary(Data d)
Constructor, specifying a data reference. |
|
PathSummary(Data d,
DataInput in)
Constructor, specifying an input file. |
Method Summary | |
---|---|
void |
close()
Closes the index. |
int |
count(IndexToken token)
Returns the (approximate/estimated) number of hits for the specified token. |
void |
data(Data d)
Sets the data reference. |
static java.util.ArrayList<PathNode> |
desc(java.util.ArrayList<PathNode> in,
boolean desc)
Returns all children or descendants of the specified nodes. |
TokenList |
desc(byte[] k,
boolean d,
boolean o)
Returns descendant tags and attributes for the specified start key. |
java.util.ArrayList<PathNode> |
desc(int n,
int k)
Returns all children or descendants of the specified nodes with the specified tag or attribute value. |
TokenList |
desc(TokenList tl,
boolean d,
boolean o)
Returns descendant tags and attributes for the specified descendant path. |
EntryIterator |
entries(IndexEntries entries)
Returns all entries that match the specified token. |
byte[] |
info()
Returns information on the index structure. |
void |
init()
Initializes the index. |
IndexIterator |
iter(IndexToken token)
Returns an iterator for the index results. |
static java.util.ArrayList<PathNode> |
parent(java.util.ArrayList<PathNode> in)
Returns all parents of the specified nodes. |
void |
put(int n,
byte k,
int l)
Adds an entry. |
void |
put(int n,
byte k,
int l,
byte[] v,
MetaData md)
Adds an entry, including its value. |
java.util.ArrayList<PathNode> |
root()
Returns the root node. |
java.lang.String |
toString()
|
void |
write(DataOutput out)
Writes the path summary to the specified output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PathSummary()
Data
reference must be set in a second step via data(Data)
.
public PathSummary(Data d)
d
- data referencepublic PathSummary(Data d, DataInput in) throws java.io.IOException
d
- data referencein
- input stream
java.io.IOException
- I/O exceptionMethod Detail |
---|
public void write(DataOutput out) throws java.io.IOException
out
- output stream
java.io.IOException
- I/O exceptionpublic void data(Data d)
d
- referencepublic void init()
Index
init
in interface Index
public void close()
Index
close
in interface Index
public void put(int n, byte k, int l)
n
- name reference (0 for nodes other than element and attributes)k
- node kindl
- current levelpublic void put(int n, byte k, int l, byte[] v, MetaData md)
n
- name reference (0 for nodes other than element and attributes)k
- node kindl
- current levelv
- valuemd
- meta datapublic java.util.ArrayList<PathNode> root()
public static java.util.ArrayList<PathNode> parent(java.util.ArrayList<PathNode> in)
in
- input nodes
public static java.util.ArrayList<PathNode> desc(java.util.ArrayList<PathNode> in, boolean desc)
in
- input nodesdesc
- if false, return only children
public java.util.ArrayList<PathNode> desc(int n, int k)
n
- name referencek
- node kind
public TokenList desc(byte[] k, boolean d, boolean o)
k
- input keyd
- if false, return only childreno
- true/false: sort by occurrence/lexicographically
public TokenList desc(TokenList tl, boolean d, boolean o)
tl
- input stepsd
- if false, return only childreno
- true/false: sort by occurrence/lexicographically
public byte[] info()
Index
info
in interface Index
public IndexIterator iter(IndexToken token)
Index
iter
in interface Index
token
- token to be found
public int count(IndexToken token)
Index
count
in interface Index
token
- token to be found
public EntryIterator entries(IndexEntries entries)
Index
entries
in interface Index
entries
- index entries
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |