Class FrequentPatternTree.FrequentPatternTreeNode<S>

java.lang.Object
org.tweetyproject.machinelearning.assoc.FrequentPatternTree.FrequentPatternTreeNode<S>
Type Parameters:
S - any object
Enclosing class:
FrequentPatternTree<T>

public class FrequentPatternTree.FrequentPatternTreeNode<S> extends Object
a node of the tree
Author:
Matthias Thimm
  • Constructor Details

    • FrequentPatternTreeNode

      public FrequentPatternTreeNode(S item, int freq_abs, FrequentPatternTree<T>.FrequentPatternTreeNode<S> parent)
      Creates a new tree node for the given item with the given frequency of the path up to this item.
      Parameters:
      item - some item
      freq_abs - the frequency of the path up to this item (as absolute value).
      parent - the parent of the node
  • Method Details

    • getChild

      public FrequentPatternTree<T>.FrequentPatternTreeNode<S> getChild(S item)
      Returns the child for the given item (if it does not exist, null is returned) and increments the freq
      Parameters:
      item - some item
      Returns:
      the child for the given item (if it does not exist, null is returned)
    • addChild

      public void addChild(FrequentPatternTree<T>.FrequentPatternTreeNode<S> node)
      Adds the child to this node
      Parameters:
      node - some node
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSinglePath

      public boolean isSinglePath()
      Checks whether the tree rooted at this node is a single path
      Returns:
      "true" if the tree rooted at this node is a single path
    • getAllItems

      public Collection<S> getAllItems()
      Collects all items in this tree and returns them.
      Returns:
      a collection of all items appearing in this tree
    • toString

      public String toString(int indent)
      Returns a string representation of the node with 2*indent leading white spaces
      Parameters:
      indent - some indent
      Returns:
      a string representation of the node