Package org.basex.index.name
Class Names
java.lang.Object
org.basex.util.hash.ASet
org.basex.util.hash.TokenSet
org.basex.index.name.Names
This class indexes and organizes the element or attribute names used in an XML document.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen, Lukas Kircher
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the index.costs(IndexSearch search) Computes costs for performing the specified search.booleandrop()Drops the index.entries(IndexEntries entries) Returns all entries that match the specified token.intindex(byte[] name) Indexes a name, updates the statistics, and returns the name id.intindex(byte[] name, byte[] value) Indexes a name, updates the statistics, and returns the name id.byte[]info(MainOptions options) Returns information on the index structure.voidinit()Initializes the index.iter(IndexSearch search) Returns an iterator for the index results.protected voidrehash(int newSize) Rehashes all entries.stats(int id) Returns the statistics for the specified key id.voidwrite(DataOutput out) Writes the data structure to the specified output.Methods inherited from class org.basex.util.hash.TokenSet
add, add, clear, contains, hash, id, iterator, key, put, read, remove, toStringMethods inherited from class org.basex.util.hash.ASet
capacity, checkSize, isEmpty, size, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Names
Default constructor.- Parameters:
meta- meta data
-
Names
Constructor, specifying an input file.- Parameters:
in- input streammeta- meta data- Throws:
IOException- I/O exception
-
-
Method Details
-
init
public void init()Initializes the index. -
index
public int index(byte[] name) Indexes a name, updates the statistics, and returns the name id.- Parameters:
name- name to be added- Returns:
- name id
-
index
public int index(byte[] name, byte[] value) Indexes a name, updates the statistics, and returns the name id.- Parameters:
name- name to be addedvalue- value, added to statistics (can benull)- Returns:
- name id
-
write
Description copied from class:TokenSetWrites the data structure to the specified output.- Overrides:
writein classTokenSet- Parameters:
out- output stream- Throws:
IOException- I/O exception
-
stats
Returns the statistics for the specified key id.- Parameters:
id- name id- Returns:
- statistics (can be
null)
-
info
Description copied from interface:IndexReturns information on the index structure. -
entries
Description copied from interface:IndexReturns all entries that match the specified token. -
rehash
protected void rehash(int newSize) Description copied from class:ASetRehashes all entries. -
close
public void close()Description copied from interface:IndexCloses the index. -
drop
public boolean drop()Description copied from interface:IndexDrops the index. Also returns true if the index does not exist. -
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.
-