org.knime.base.node.mine.subgroupminer.apriori
Class ArrayPrefixTreeNode

java.lang.Object
  extended by org.knime.base.node.mine.subgroupminer.apriori.ArrayPrefixTreeNode

public class ArrayPrefixTreeNode
extends Object

An ArrayPrefixTreeNode contains an array containing the counter for the items, where the array position serves as the item identifier. Each item may have a child, again, the array position serves as the identifier for that child, that is, the child for item x is in children[x]. Although this implicates a waste of storage the accessing time is linear. Additionally, a link to the parent node and the referring index to the prefix is stored.

Author:
Fabian Dill, University of Konstanz

Constructor Summary
ArrayPrefixTreeNode(int length, ArrayPrefixTreeNode parent, int parentIndex)
          Constructs an ArrayPrefixTreeNode with the length specifying the size of the array, that is, the number of countable items in that node.
 
Method Summary
 void createChildAt(int pos)
          Creates an empty child for the item specified by pos.
 boolean createChildren(int minSupport)
          Creates emtpy children for all items, whose support is greater or equal to minSupport.
 void deleteChild(int pos)
          Deletes the child for the item specified by its position pos.
 ArrayPrefixTreeNode getChild(int pos)
          Returns the child for that given item specified by pos.
 int getCounterFor(int pos)
          Returns the counter, the support, for the item with identifier pos.
 int getLength()
          Returns the length of the array, that is, the umber of countable items.
 ArrayPrefixTreeNode getParent()
          Retuns a link to the parent node.
 int getParentIndex()
          Returns the parent index, the prefix.
 int getSumOfCounter()
          Returns the sum of that counter for a pruning heuristic.
 void increment(int pos)
          Increments the counter for the item with id = pos.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayPrefixTreeNode

public ArrayPrefixTreeNode(int length,
                           ArrayPrefixTreeNode parent,
                           int parentIndex)
Constructs an ArrayPrefixTreeNode with the length specifying the size of the array, that is, the number of countable items in that node. Additionally, a link to the parent node with the index of the predecessor item, that is, the prefix.

Parameters:
length - the number of countable items in that node
parent - the parent node
parentIndex - the index of the prefix item
Method Detail

getParentIndex

public int getParentIndex()
Returns the parent index, the prefix.

Returns:
the parent index, the prefix

getParent

public ArrayPrefixTreeNode getParent()
Retuns a link to the parent node.

Returns:
a link to the parent node

getLength

public int getLength()
Returns the length of the array, that is, the umber of countable items.

Returns:
the number of countable items

increment

public void increment(int pos)
Increments the counter for the item with id = pos.

Parameters:
pos - the identifier for that item equal to its position in the array

getCounterFor

public int getCounterFor(int pos)
Returns the counter, the support, for the item with identifier pos.

Parameters:
pos - the identifier for that item equal to its position in the array
Returns:
the counter or support for the item specified by pos

getSumOfCounter

public int getSumOfCounter()
Returns the sum of that counter for a pruning heuristic.

Returns:
the sum of all counters

deleteChild

public void deleteChild(int pos)
Deletes the child for the item specified by its position pos.

Parameters:
pos - the position of the item whose child should be deleted

getChild

public ArrayPrefixTreeNode getChild(int pos)
Returns the child for that given item specified by pos.

Parameters:
pos - the identifier, position of the item, whose child should be returned
Returns:
the child of the item specified by pos

createChildAt

public void createChildAt(int pos)
Creates an empty child for the item specified by pos.

Parameters:
pos - the identifier, position of the item, for which a child should be created

createChildren

public boolean createChildren(int minSupport)
Creates emtpy children for all items, whose support is greater or equal to minSupport.

Parameters:
minSupport - the support which an item should at least have that a child for is created
Returns:
true if any child was created, false otherwise

toString

public String toString()

Overrides:
toString in class Object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.