## org.apache.mahout.fpm.pfpgrowth
Class TransactionTree

    java.lang.Object
      org.apache.mahout.fpm.pfpgrowth.TransactionTree

All Implemented Interfaces:
  org.apache.hadoop.io.Writable

    public final class TransactionTree

extends java.lang.Object
implements org.apache.hadoop.io.Writable

A compact representation of transactions modeled on the lines to `FPTree` This reduces plenty of space and speeds up Map/Reduce of `PFPGrowth` algorithm by reducing data size passed from the Mapper to the reducer where `FPGrowth` mining is done

Nested Class Summary
`class` `TransactionTree.TransactionTreeIterator` Generates a List of transactions view of Transaction Tree by doing Depth First Traversal on the tree structure

Constructor Summary
`TransactionTree()`
`TransactionTree(int size)`
`TransactionTree(java.lang.Integer[] items, java.lang.Long support)`
`TransactionTree(java.util.List<Pair<java.util.List<java.lang.Integer>,java.lang.Long>> transactionSet)`

Method Summary
`void` `addChild(int parentNodeId, int childnodeId)`
`boolean` `addCount(int nodeId, long nextNodeCount)`
`int` `addPattern(java.util.List<java.lang.Integer> myList, long addCount)`
`int` `attribute(int nodeId)`
`int` `childAtIndex(int nodeId, int index)`
`int` `childCount()`
`int` `childCount(int nodeId)`
`int` `childWithAttribute(int nodeId, int childAttribute)`
`long` `count(int nodeId)`
`java.util.Map<java.lang.Integer,org.apache.commons.lang.mutable.MutableLong>` `generateFList()`
`TransactionTree` `getCompressedTree()`
`java.util.Iterator<Pair<java.util.List<java.lang.Integer>,java.lang.Long>>` `getIterator()`
`boolean` `isTreeEmpty()`
`void` `readFields(java.io.DataInput in)`
`void` `write(java.io.DataOutput out)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TransactionTree

    public TransactionTree()

### TransactionTree

    public TransactionTree(int size)

### TransactionTree

    public TransactionTree(java.lang.Integer[] items,
                           java.lang.Long support)

### TransactionTree

    public TransactionTree(java.util.List<Pair<java.util.List<java.lang.Integer>,java.lang.Long>> transactionSet)

Method Detail

### addChild

    public void addChild(int parentNodeId,
                         int childnodeId)

### addCount

    public boolean addCount(int nodeId,
                            long nextNodeCount)

### addPattern

    public int addPattern(java.util.List<java.lang.Integer> myList,
                          long addCount)

### attribute

    public int attribute(int nodeId)

### childAtIndex

    public int childAtIndex(int nodeId,
                            int index)

### childCount

    public int childCount()

### childCount

    public int childCount(int nodeId)

### childWithAttribute

    public int childWithAttribute(int nodeId,
                                  int childAttribute)

### count

    public long count(int nodeId)

### generateFList

    public java.util.Map<java.lang.Integer,org.apache.commons.lang.mutable.MutableLong> generateFList()

### getCompressedTree

    public TransactionTree getCompressedTree()

### getIterator

    public java.util.Iterator<Pair<java.util.List<java.lang.Integer>,java.lang.Long>> getIterator()

### isTreeEmpty

    public boolean isTreeEmpty()

### readFields

    public void readFields(java.io.DataInput in)
                    throws java.io.IOException

  Specified by:
    `readFields` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.DataOutput out)
               throws java.io.IOException

  Specified by:
    `write` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.