|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnetkit.util.Histogram
public abstract class Histogram
This abstract class represents a histogram on Node field values. The histogram keeps track of unique values and a running of how many times each value appeared.
Attribute
,
Node
Field Summary | |
---|---|
protected java.util.Map<java.lang.Integer,java.lang.Double> |
cMap
|
Constructor Summary | |
---|---|
protected |
Histogram(double[] values,
Attribute attribute,
int minOccurance)
This constructor creates a histogram object given an array of values and an attribute type. |
protected |
Histogram(Edge[] edges,
Attribute attribute,
int minOccurance)
This constructor creates a histogram object given an array of edges and an attribute from which to get the values. |
protected |
Histogram(Node[] nodes,
Attribute attribute,
int minOccurance)
This constructor creates a histogram object given an array of nodes and an attribute from which to get the values. |
Method Summary | |
---|---|
double |
getCount(int value)
Gets the number of times a particular value appears in this histogram. |
double[] |
getDistribution()
Gets the distribution of values of this histogram, in no particular order. |
int |
getMode()
Gets the "mode" for this set of values. |
java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Double>> |
getSet()
Gets the set of value->count pairs in this histogram. |
double |
getTotalCount()
Gets the cumulative number of times all values appear in this histogram. |
static void |
main(java.lang.String[] args)
This is a main driver to test the Histogram hierarchy classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.Map<java.lang.Integer,java.lang.Double> cMap
Constructor Detail |
---|
protected Histogram(double[] values, Attribute attribute, int minOccurance)
values
- the array of double values for this object.attribute
- the attribute describing the field type.minOccurance
- the minimum number of times a value must
occur before being kept in this histogram.
java.lang.RuntimeException
- if minOccurance is less than 1.protected Histogram(Node[] nodes, Attribute attribute, int minOccurance)
nodes
- the array of Nodes from which to get values.attribute
- the attribute describing the field in the Node
to get values from.minOccurance
- the minimum number of times a value must
occur before being kept in this histogram.
java.lang.RuntimeException
- if minOccurance is less than 1.protected Histogram(Edge[] edges, Attribute attribute, int minOccurance)
edges
- the array of Edges from which to get weight + attribute values.attribute
- the attribute describing the field in the Node
to get values from.minOccurance
- the minimum number of times a value must
occur before being kept in this histogram.
java.lang.RuntimeException
- if minOccurance is less than 1.Method Detail |
---|
public int getMode()
public double getCount(int value)
value
- the value to lookup in the histogram.
public double getTotalCount()
public double[] getDistribution()
public java.util.Set<java.util.Map.Entry<java.lang.Integer,java.lang.Double>> getSet()
public static final void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |