Class TupleKeyCountTree


  • @API(EXPERIMENTAL)
    public class TupleKeyCountTree
    extends Object
    A tree of occurrence counts tuple-encoded keys.
    • Method Detail

      • getBytes

        @Nonnull
        public byte[] getBytes()
      • hasObject

        public boolean hasObject()
      • add

        public void add​(@Nonnull
                        Tuple tuple)
        Add the given tuple to the tree. Each element is added to the next deeper level in the tree, incrementing the count as it goes.
        Parameters:
        tuple - the tuple to add
      • add

        public void add​(@Nonnull
                        byte[] packed)
        Add encoded tuple bytes to the tree.
        Parameters:
        packed - the packed form of a tuple to be parsed and added to the tree
      • addPrefixChild

        @Nonnull
        public TupleKeyCountTree addPrefixChild​(@Nonnull
                                                Object prefix)
        Add a non-tuple object to the root of the tree.
        Parameters:
        prefix - an object for the top level child of the tree
        Returns:
        a subtree for the given object
      • getCount

        public int getCount()
      • isVisible

        public boolean isVisible()
      • setVisible

        public void setVisible​(boolean visible)
      • hideLessThanFraction

        public void hideLessThanFraction​(double fraction)
        Hide tree nodes that do not have counts at least as great as the given fraction of their parent node.
        Parameters:
        fraction - the threshold count fraction
      • printTree

        public void printTree​(@Nonnull
                              TupleKeyCountTree.Printer printer,
                              @Nullable
                              String collapseSeparator)
        Print this tree to the given printer.
        Parameters:
        printer - the printer to be called for each visible level of the tree
        collapseSeparator - a string to be used to separate the printed forms of levels with only a single child