|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.util.hash.ASet
org.basex.util.hash.TokenSet
org.basex.index.name.Names
public final class Names
This class indexes and organizes the tags or attribute names, used in an XML document.
Field Summary |
---|
Fields inherited from class org.basex.util.hash.TokenSet |
---|
keys |
Fields inherited from class org.basex.util.hash.ASet |
---|
bucket, next, size |
Constructor Summary | |
---|---|
Names(DataInput in,
MetaData md)
Constructor, specifying an input file. |
|
Names(MetaData md)
Default constructor. |
Method Summary | |
---|---|
void |
close()
Closes the index. |
int |
count(IndexToken token)
Returns the (approximate/estimated) number of hits for the specified token. |
EntryIterator |
entries(IndexEntries entries)
Returns all entries that match the specified token. |
int |
index(byte[] n,
byte[] v,
boolean st)
Indexes a name and returns its unique id. |
void |
index(int n,
byte[] v)
Adds a value to the statistics of the specified key. |
byte[] |
info()
Returns information on the index structure. |
void |
init()
Initializes the index. |
IndexIterator |
iter(IndexToken token)
Returns an iterator for the index results. |
protected void |
rehash(int s)
Rehashes all entries. |
Stats |
stat(int id)
Returns the statistics for the specified key id. |
void |
write(DataOutput out)
Writes the data structure to the specified output. |
Methods inherited from class org.basex.util.hash.TokenSet |
---|
add, add, clear, contains, delete, hash, id, iterator, key, put, read, toString |
Methods inherited from class org.basex.util.hash.ASet |
---|
checkSize, isEmpty, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Names(MetaData md)
md
- meta datapublic Names(DataInput in, MetaData md) throws java.io.IOException
in
- input streammd
- meta data
java.io.IOException
- I/O exceptionMethod Detail |
---|
public void init()
Index
init
in interface Index
public int index(byte[] n, byte[] v, boolean st)
n
- name to be addedv
- value, added to statisticsst
- statistics flag
public void index(int n, byte[] v)
n
- name idv
- value, added to statisticspublic void write(DataOutput out) throws java.io.IOException
TokenSet
write
in class TokenSet
out
- output stream
java.io.IOException
- I/O exceptionpublic Stats stat(int id)
id
- id
public byte[] info()
Index
info
in interface Index
public EntryIterator entries(IndexEntries entries)
Index
entries
in interface Index
entries
- index entries
protected void rehash(int s)
ASet
rehash
in class TokenSet
s
- new hash sizepublic void close()
Index
close
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |