com.rapidminer.operator.learner.associations.fpgrowth
Class FPTreeNode

java.lang.Object
  extended by com.rapidminer.operator.learner.associations.fpgrowth.FPTreeNode
Direct Known Subclasses:
FPTree

public class FPTreeNode
extends java.lang.Object

A node in the FPTree.

Author:
Sebastian Land

Field Summary
protected  java.util.Map<Item,FPTreeNode> children
           
protected  FPTreeNode father
           
protected  FrequencyStack frequencies
           
protected  Item nodeItem
           
protected  FPTreeNode sibling
           
 
Constructor Summary
FPTreeNode()
           
FPTreeNode(FPTreeNode father, Item nodeItem)
           
 
Method Summary
 void addItemSet(java.util.Collection<Item> itemSet, java.util.Map<Item,Header> headerTable, int weight)
          This method only works at recursiondepth 0, therefore may only be used for tree constructing.
 FPTreeNode createChildNode(Item nodeItem)
          this method creates a new childnode of this node, representing the node item
 FPTreeNode getChild()
          This method returns the first child.
 java.util.Map<Item,FPTreeNode> getChildren()
          This returns the map, which maps the child nodes on items.
 FPTreeNode getFather()
          Returns the father of this node or null if node is root
 int getFrequency(int height)
          this returns the frequency of the node in current recursion
 FPTreeNode getLastSibling()
          Returns the last node of the chain of nodes representing the same item as this node
 Item getNodeItem()
          this returns the item, this node represents
 FPTreeNode getSibling()
          Returns the next node representing the same item as this node.
 boolean hasFather()
          Returns true if node has father.
 boolean hasSibling()
          Returns true if this node is not the last one in the chain of nodes representing the same item as this node.
 void increaseFrequency(int recursionDepth, int value)
          This method increases the frequency of this current node by the given weight in given recusionDepth
 void popFrequency(int height)
          This method clears the frequency stack on top
 void setSibling(FPTreeNode sibling)
          This method sets the next node in the chain of node representing the same item as this node
 java.lang.String toString(int recursionDepth)
           
 java.lang.String toString(java.lang.String abs, int recursionDepth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frequencies

protected FrequencyStack frequencies

nodeItem

protected Item nodeItem

sibling

protected FPTreeNode sibling

father

protected FPTreeNode father

children

protected java.util.Map<Item,FPTreeNode> children
Constructor Detail

FPTreeNode

public FPTreeNode()

FPTreeNode

public FPTreeNode(FPTreeNode father,
                  Item nodeItem)
Method Detail

addItemSet

public void addItemSet(java.util.Collection<Item> itemSet,
                       java.util.Map<Item,Header> headerTable,
                       int weight)
This method only works at recursiondepth 0, therefore may only be used for tree constructing. This method adds a set of Items to the tree of this node. This set of items has to be sorted after the frequency of the contained items. This method is recursivly used to expand the tree for the given set, by adding a node for the first item and then call this method with the remaining set on the new node. The frequency of the set is represented of weight. siblingChain is the headerTable, giving this method a startingpoint for finding the other nodes of the item to append new nodes

Parameters:
itemSet - the sorted set of items
headerTable - gives the headertable for finding other nodes of an item

getFather

public FPTreeNode getFather()
Returns the father of this node or null if node is root


hasFather

public boolean hasFather()
Returns true if node has father. If node is root, false is returned


getSibling

public FPTreeNode getSibling()
Returns the next node representing the same item as this node.


getLastSibling

public FPTreeNode getLastSibling()
Returns the last node of the chain of nodes representing the same item as this node


setSibling

public void setSibling(FPTreeNode sibling)
This method sets the next node in the chain of node representing the same item as this node

Parameters:
sibling - is the next node in the chain

hasSibling

public boolean hasSibling()
Returns true if this node is not the last one in the chain of nodes representing the same item as this node. Otherwise false is returned.


increaseFrequency

public void increaseFrequency(int recursionDepth,
                              int value)
This method increases the frequency of this current node by the given weight in given recusionDepth

Parameters:
value - the frequency is increased by this value

popFrequency

public void popFrequency(int height)
This method clears the frequency stack on top


getFrequency

public int getFrequency(int height)
this returns the frequency of the node in current recursion


getNodeItem

public Item getNodeItem()
this returns the item, this node represents


getChildren

public java.util.Map<Item,FPTreeNode> getChildren()
This returns the map, which maps the child nodes on items. It may be used to get a set of all childNodes or all represented items.


getChild

public FPTreeNode getChild()
This method returns the first child. If no child exists, null is returned


createChildNode

public FPTreeNode createChildNode(Item nodeItem)
this method creates a new childnode of this node, representing the node item

Parameters:
nodeItem - the item, represented by the new node

toString

public java.lang.String toString(int recursionDepth)

toString

public java.lang.String toString(java.lang.String abs,
                                 int recursionDepth)


Copyright © 2001-2009 by Rapid-I