Class FrequentPatternTree.FrequentPatternTreeNode<S>
java.lang.Object
org.tweetyproject.machinelearning.assoc.FrequentPatternTree.FrequentPatternTreeNode<S>
- Type Parameters:
S
- any object
- Enclosing class:
FrequentPatternTree<T>
a node of the tree
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorDescriptionFrequentPatternTreeNode
(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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the child to this nodeCollects all items in this tree and returns them.Returns the child for the given item (if it does not exist, null is returned) and increments the freqboolean
Checks whether the tree rooted at this node is a single pathtoString()
toString
(int indent) Returns a string representation of the node with2*indent
leading white spaces
-
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 itemfreq_abs
- the frequency of the path up to this item (as absolute value).parent
- the parent of the node
-
-
Method Details
-
getChild
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
Adds the child to this node- Parameters:
node
- some node
-
toString
-
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
Collects all items in this tree and returns them.- Returns:
- a collection of all items appearing in this tree
-
toString
Returns a string representation of the node with2*indent
leading white spaces- Parameters:
indent
- some indent- Returns:
- a string representation of the node
-