|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.flaptor.hist4j.HistogramNode
com.flaptor.hist4j.HistogramForkNode
public class HistogramForkNode
The HistogramForkNode splits the data range in two at a given value, pointing to two subtrees, one for values smaller than the split value, and one for values larger than the split value. It implements the recursive calls necesary to obtain the data from the tree structure.
| Constructor Summary | |
|---|---|
HistogramForkNode(float splitValue,
HistogramNode left,
HistogramNode right)
Creates a fork node with the given split value and subtrees. |
|
| Method Summary | |
|---|---|
HistogramNode |
addValue(AdaptiveHistogram root,
float value)
Adds a value to the histogram by recursively adding the value to either subtree, depending on the split value. |
void |
apply(AdaptiveHistogram.ValueConversion valueConversion)
Applies a convertion function to the values stored in the histogram. |
long |
getAccumCount(float value)
Returns the cumulative density function for a given data point. |
long |
getCount(float value)
Returns the number of data points stored in the same bucket as a given value. |
java.lang.Float |
getValueForAccumCount(long[] accumCount)
Returns the data point where the running cumulative count reaches the target cumulative count. |
void |
reset()
Clears the fork node, recursively erasing the subtrees. |
void |
show(int level)
Prints the data for the nodes in its subtrees. |
void |
toTable(java.util.ArrayList<Cell> table)
Build the table representing the histogram data adding the data from each subtree. |
| Methods inherited from class com.flaptor.hist4j.HistogramNode |
|---|
margin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HistogramForkNode(float splitValue,
HistogramNode left,
HistogramNode right)
splitValue - the value that splits both subtrees.left - the left subtree.right - the right subtree.| Method Detail |
|---|
public void reset()
reset in class HistogramNode
public HistogramNode addValue(AdaptiveHistogram root,
float value)
addValue in class HistogramNoderoot - a reference to the adaptive histogram instance that uses this structure.value - the value for which the count is to be incremented.
public long getCount(float value)
getCount in class HistogramNodevalue - the reference data point.
public long getAccumCount(float value)
getAccumCount in class HistogramNodevalue - the reference data point.
public java.lang.Float getValueForAccumCount(long[] accumCount)
getValueForAccumCount in class HistogramNodeaccumCount - accumCount[0] the running cumulative count.
accumCount[1] the target cumulative count.
public void apply(AdaptiveHistogram.ValueConversion valueConversion)
apply in class HistogramNodevalueConversion - a class that defines a function to convert the value.public void show(int level)
show in class HistogramNodelevel - the level of this node in the tree.public void toTable(java.util.ArrayList<Cell> table)
toTable in class HistogramNode
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||