Commit ea36a18a authored by Daniel Eggert's avatar Daniel Eggert
Browse files

added getMin for histogram validation

parent 4f4b7861
......@@ -57,10 +57,19 @@ public class LabeledHistogram {
return max;
}
public int getMin() {
int min = Integer.MAX_VALUE;
for (int val : histMap.values()) {
min = Math.min(min, val);
}
return min;
}
public void clearZeroLabels() {
for(Iterator<Entry<String, Integer>> iter = histMap.entrySet().iterator(); iter.hasNext();) {
for (Iterator<Entry<String, Integer>> iter = histMap.entrySet().iterator(); iter.hasNext();) {
Entry<String, Integer> e = iter.next();
if(e.getValue() == 0) {
if (e.getValue() == 0) {
iter.remove();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment