Class Stats

java.lang.Object
org.basex.index.stats.Stats

public final class Stats extends Object
This class provides statistical data for an indexed node.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Details

    • values

      public TokenIntMap values
      Distinct values (value, number of occurrence).
    • min

      public double min
      Minimum value.
    • max

      public double max
      Maximum value.
    • count

      public int count
      Number of occurrences.
    • type

      public byte type
      Data type.
  • Constructor Details

    • Stats

      public Stats()
      Default constructor.
    • Stats

      public Stats(DataInput in) throws IOException
      Constructor, specifying an input stream.
      Parameters:
      in - input stream
      Throws:
      IOException - I/O exception
  • Method Details

    • write

      public void write(DataOutput out) throws IOException
      Writes the key statistics to the specified output stream.
      Parameters:
      out - output stream
      Throws:
      IOException - I/O exception
    • add

      public void add(byte[] value, MetaData meta)
      Adds a value. All values are first treated as integer values. If a value cannot 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 a maximum, the cached values are skipped, and contents are treated as arbitrary strings.
      Parameters:
      value - value to be added
      meta - meta data
    • isLeaf

      public boolean isLeaf()
      Getter for leaf flag.
      Returns:
      leaf flag
    • setLeaf

      public void setLeaf(boolean l)
      Setter for leaf flag.
      Parameters:
      l - leaf or not
    • toString

      public String toString()
      Overrides:
      toString in class Object