## org.apache.mahout.math.stats
Class GroupTree

    java.lang.Object
      org.apache.mahout.math.stats.GroupTree

All Implemented Interfaces:
  Iterable<TDigest.Group>

    public class GroupTree

extends Object
implements Iterable<TDigest.Group>

A tree containing TDigest.Group. This adds to the normal NavigableSet the ability to sum up the size of elements to the left of a particular group.

Constructor Summary
`GroupTree()`
`GroupTree(GroupTree left, GroupTree right)`
`GroupTree(TDigest.Group leaf)`

Method Summary
`void` `add(TDigest.Group group)`
`TDigest.Group` `ceiling(TDigest.Group base)`
`void` `checkBalance()`
`TDigest.Group` `first()`
`TDigest.Group` `floor(TDigest.Group base)`
`int` `headCount(TDigest.Group base)`
`int` `headSum(TDigest.Group base)`
`Iterator<TDigest.Group>` `iterator()` Iteratres through all groups in the tree.
`TDigest.Group` `last()`
`void` `print(int depth)`
`void` `remove(TDigest.Group base)`
`int` `size()`
`int` `sum()`
`Iterable<TDigest.Group>` `tailSet(TDigest.Group start)`

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

Constructor Detail

### GroupTree

    public GroupTree()

### GroupTree

    public GroupTree(TDigest.Group leaf)

### GroupTree

    public GroupTree(GroupTree left,
                     GroupTree right)

Method Detail

### add

    public void add(TDigest.Group group)

### size

    public int size()

### headCount

    public int headCount(TDigest.Group base)

  Returns:
    the number of items strictly before the current element

### headSum

    public int headSum(TDigest.Group base)

  Returns:
    the sum of the size() function for all elements strictly before the current element.

### first

    public TDigest.Group first()

  Returns:
    the first Group in this set

### iterator

    public Iterator<TDigest.Group> iterator()

  Iteratres through all groups in the tree.

  Specified by:
    `iterator` in interface `Iterable<TDigest.Group>`

### remove

    public void remove(TDigest.Group base)

### floor

    public TDigest.Group floor(TDigest.Group base)

  Returns:
    the largest element less than or equal to base

### last

    public TDigest.Group last()

### ceiling

    public TDigest.Group ceiling(TDigest.Group base)

  Returns:
    the smallest element greater than or equal to base.

### tailSet

    public Iterable<TDigest.Group> tailSet(TDigest.Group start)

  Returns:
    the subset of elements equal to or greater than base.

### sum

    public int sum()

### checkBalance

    public void checkBalance()

### print

    public void print(int depth)

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