org.basex.index
Class Names

java.lang.Object
  extended by org.basex.util.Set
      extended by org.basex.index.Names

public final class Names
extends Set

This class indexes and organizes the tags or attribute names, used in an XML document.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen, Lukas Kircher

Constructor Summary
Names()
          Empty Constructor.
Names(DataInput in)
          Constructor, specifying an input file.
 
Method Summary
 int index(byte[] k, byte[] v, boolean st)
          Indexes a name and returns its unique id.
 void index(int i, byte[] v)
          Evaluates the value for the specified key id.
 byte[] info()
          Returns index information.
 void init()
          Initializes the statistics.
 StatsKey stat(int id)
          Returns the statistics for the specified key id.
 void write(DataOutput out)
          Writes the names to the specified output stream.
 
Methods inherited from class org.basex.util.Set
add, delete, id, key, keys, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Names

public Names()
Empty Constructor.


Names

public Names(DataInput in)
      throws java.io.IOException
Constructor, specifying an input file.

Parameters:
in - input stream
Throws:
java.io.IOException - I/O exception
Method Detail

init

public void init()
Initializes the statistics.


index

public int index(byte[] k,
                 byte[] v,
                 boolean st)
Indexes a name and returns its unique id.

Parameters:
k - name to be found
v - value, evaluated in statistics
st - statistics flag
Returns:
name id

index

public void index(int i,
                  byte[] v)
Evaluates the value for the specified key id.

Parameters:
i - key id
v - value, used for statistics

write

public void write(DataOutput out)
           throws java.io.IOException
Writes the names to the specified output stream.

Parameters:
out - output stream
Throws:
java.io.IOException - in case the file could not be written

stat

public StatsKey stat(int id)
Returns the statistics for the specified key id.

Parameters:
id - id
Returns:
statistics

info

public byte[] info()
Returns index information.

Returns:
statistics string