|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvsp.Histogram
public class Histogram
Generates histogram
Field Summary | |
---|---|
private long |
from
|
private int[] |
histogram
|
private static char |
MARK
|
private static int |
MARKS_COUNT
|
private double |
step
|
private long |
to
|
private java.util.ArrayList<java.lang.Double> |
values
|
Constructor Summary | |
---|---|
Histogram(Params params,
int steps)
Create histogram |
Method Summary | |
---|---|
void |
addValue(double num)
Add new value to histogram |
private int[] |
fillZeros(int[] array)
Fill empty arrays with zero |
java.util.ArrayList<Item> |
generateHistogram()
Generate histogram without printing |
private int |
maxValue(int[] array)
Maximum numbers from one value |
void |
printHistogram()
Print histogram to STDOUT |
java.lang.String |
toString()
Basic string output for development |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int MARKS_COUNT
private static final char MARK
private java.util.ArrayList<java.lang.Double> values
private long from
private long to
private double step
private int[] histogram
Constructor Detail |
---|
public Histogram(Params params, int steps)
from
- histogram beginto
- histogram endsteps
- number of stepsMethod Detail |
---|
public void addValue(double num)
num
- new number to histogramprivate int[] fillZeros(int[] array)
array
- new array
public java.lang.String toString()
toString
in class java.lang.Object
public void printHistogram()
public java.util.ArrayList<Item> generateHistogram()
private int maxValue(int[] array)
array
- with numbers
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |