Constructor and Description |
---|
PathSummary()
Constructor.
|
PathSummary(Data data)
Constructor, specifying a data reference.
|
PathSummary(Data data,
DataInput in)
Constructor, specifying an input file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the index.
|
int |
costs(IndexToken token)
Returns a cost estimation for searching the specified token.
|
void |
data(Data dt)
Sets the data reference.
|
static ArrayList<PathNode> |
desc(ArrayList<PathNode> nodes,
boolean desc)
Returns all children or descendants of the specified nodes.
|
ArrayList<PathNode> |
desc(byte[] name)
Returns all descendants with the specified element name.
|
TokenList |
desc(byte[] name,
boolean desc,
boolean occ)
Returns descendant element and attribute names for the specified start key.
|
TokenList |
desc(TokenList names,
boolean desc,
boolean occ)
Returns descendant element and attribute names for the specified descendant path.
|
boolean |
drop()
Drops the index.
|
EntryIterator |
entries(IndexEntries entries)
Returns all entries that match the specified token.
|
byte[] |
info(MainOptions options)
Returns information on the index structure.
|
void |
init()
Initializes the index.
|
IndexIterator |
iter(IndexToken token)
Returns an iterator for the index results.
|
static ArrayList<PathNode> |
parent(ArrayList<PathNode> nodes)
Returns all parents of the specified nodes.
|
void |
put(int name,
byte kind,
int level)
Adds an entry.
|
void |
put(int name,
byte kind,
int level,
byte[] value,
MetaData meta)
Adds an entry, including its value.
|
ArrayList<PathNode> |
root()
Returns the root node.
|
String |
toString() |
void |
write(DataOutput out)
Writes the path summary to the specified output.
|
public PathSummary()
Data
reference must be set in a second step via data(Data)
.public PathSummary(Data data)
data
- data referencepublic PathSummary(Data data, DataInput in) throws IOException
data
- data referencein
- input streamIOException
- I/O exceptionpublic void write(DataOutput out) throws IOException
out
- output streamIOException
- I/O exceptionpublic void data(Data dt)
dt
- referencepublic void init()
Index
public void close()
Index
public void put(int name, byte kind, int level)
name
- name reference (0 for nodes other than element and attributes)kind
- node kindlevel
- current levelpublic void put(int name, byte kind, int level, byte[] value, MetaData meta)
name
- name reference (0 for nodes other than element and attributes)kind
- node kindlevel
- current levelvalue
- valuemeta
- meta datapublic static ArrayList<PathNode> parent(ArrayList<PathNode> nodes)
nodes
- input nodespublic static ArrayList<PathNode> desc(ArrayList<PathNode> nodes, boolean desc)
nodes
- input nodesdesc
- if false, return only childrenpublic ArrayList<PathNode> desc(byte[] name)
name
- local namepublic TokenList desc(byte[] name, boolean desc, boolean occ)
name
- input keydesc
- if false, return only childrenocc
- true/false: sort by occurrence/lexicographicallypublic TokenList desc(TokenList names, boolean desc, boolean occ)
names
- input stepsdesc
- if false, return only childrenocc
- true/false: sort by occurrence/lexicographicallypublic byte[] info(MainOptions options)
Index
public boolean drop()
Index
public IndexIterator iter(IndexToken token)
Index
public int costs(IndexToken token)
Index
public EntryIterator entries(IndexEntries entries)
Index
Copyright © 2005–2015 BaseX Team. All rights reserved.