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

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

All Implemented Interfaces:
  Iterable<Pair<IntArrayList,Long>>, org.apache.hadoop.io.Writable

    public final class TransactionTree

extends Object
implements org.apache.hadoop.io.Writable, Iterable<Pair<IntArrayList,Long>>

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

Constructor Summary
`TransactionTree()`
`TransactionTree(int size)`
`TransactionTree(IntArrayList items, Long support)`
`TransactionTree(List<Pair<IntArrayList,Long>> transactionSet)`

Method Summary
`void` `addChild(int parentNodeId, int childnodeId)`
`void` `addCount(int nodeId, long nextNodeCount)`
`int` `addPattern(IntArrayList 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)`
`Map<Integer,org.apache.commons.lang3.mutable.MutableLong>` `generateFList()`
`TransactionTree` `getCompressedTree()`
`boolean` `isTreeEmpty()`
`Iterator<Pair<IntArrayList,Long>>` `iterator()`
`void` `readFields(DataInput in)`
`void` `write(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(IntArrayList items,
                           Long support)

### TransactionTree

    public TransactionTree(List<Pair<IntArrayList,Long>> transactionSet)

Method Detail

### addChild

    public void addChild(int parentNodeId,
                         int childnodeId)

### addCount

    public void addCount(int nodeId,
                         long nextNodeCount)

### addPattern

    public int addPattern(IntArrayList 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 Map<Integer,org.apache.commons.lang3.mutable.MutableLong> generateFList()

### getCompressedTree

    public TransactionTree getCompressedTree()

### iterator

    public Iterator<Pair<IntArrayList,Long>> iterator()

  Specified by:
    `iterator` in interface `Iterable<Pair<IntArrayList,Long>>`

### isTreeEmpty

    public boolean isTreeEmpty()

### readFields

    public void readFields(DataInput in)
                    throws IOException

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

### write

    public void write(DataOutput out)
               throws IOException

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

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.