Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.basex.data
Class StatsKey

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

    public final class StatsKey

extends java.lang.Object

This class provides statistics for a tag or attribute name and its contents.

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

Nested Class Summary
`static class` | `StatsKey.Kind` Kind of Contents.

Field Summary
`Set` | `cats` Categories.
`int` | `counter` Number of occurrences.
`StatsKey.Kind` | `kind` Node kind.
`boolean` | `leaf` Leaf node flag.
`double` | `len` Average text-length.
`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.

### len

    public double len

  Average text-length.

### counter

    public int counter

  Number of occurrences.

### leaf

    public boolean leaf

  Leaf node flag.

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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD