org.basex.data
Class StatsKey

java.lang.Object
  extended by org.basex.data.StatsKey

public final class StatsKey
extends java.lang.Object

This class contains statistics for the tag or attribute name of a document.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Nested Class Summary
static class StatsKey.Kind
          Kind of Contents.
 
Field Summary
 Set cats
          Categories.
 StatsKey.Kind kind
          Node kind.
 double max
          Maximum value.
 double min
          Minimum value.
 
Constructor Summary
StatsKey()
          Default Constructor.
StatsKey(DataInput in)
          Constructor, specifying an input stream.
 
Method Summary
 void add(byte[] val)
          Adds a value.
 void finish(DataOutput out)
          Writes the key statistics to the specified output stream.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kind

public StatsKey.Kind kind
Node kind.


cats

public Set cats
Categories.


min

public double min
Minimum value.


max

public double max
Maximum value.

Constructor Detail

StatsKey

public StatsKey()
Default Constructor.


StatsKey

public StatsKey(DataInput in)
         throws java.io.IOException
Constructor, specifying an input stream.

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

finish

public void finish(DataOutput out)
            throws java.io.IOException
Writes the key statistics to the specified output stream.

Parameters:
out - output stream
Throws:
java.io.IOException - I/O exception

add

public void add(byte[] val)
Adds a value. All values are first treated as integer values. If a value can't be converted to an integer, it is treated as double value. If conversion fails again, it is handled as string category. Next, all values are cached. As soon as their number exceeds MAXCATS, the cached values are skipped, and contents are treated as arbitrary strings.

Parameters:
val - value to be added

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object