Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package net.jqwik.api.statistics;
import java.util.*;
import java.util.logging.*;
import java.util.stream.*;
import org.apiguardian.api.*;
import static org.apiguardian.api.API.Status.*;
/**
* A statistics report format to display collected statistics entries as a histogram
*/
@API(status = EXPERIMENTAL, since = "1.3.0")
public class Histogram implements StatisticsReportFormat {
private static final Logger LOG = Logger.getLogger(Histogram.class.getName());
static final char BOX = '\u25a0';
@Override
public List formatReport(List entries) {
if (entries.isEmpty()) {
throw new IllegalArgumentException("Entries must not be empty");
}
try {
entries.sort(comparator());
List buckets = cluster(entries);
return generateHistogram(entries, buckets);
} catch (Throwable throwable) {
LOG.log(Level.WARNING, "Cannot draw histogram", throwable);
return Collections.singletonList("Cannot draw histogram: " + throwable.toString());
}
}
/**
* Determine how many block characters are maximally used to draw the distribution.
* The more you have the further the histogram extends to the right.
*
*
* Can be overridden.
*
*
* @return A positive number. Default is 80.
*/
protected int maxDrawRange() {
return 80;
}
/**
* Determine how entries are being sorted from top to bottom.
*
*