/** * Exposes efficient method for accessing values in this map. */ public IntCollection values() { return counts.values(); }
/** * This method returns the sum of counts computed by the data structure. This is always less * than rowsScanned, the number of rows in the table. * @return The sum of all counts stored in the hash-map. */ private int getTotalCount() { return this.hMap.values().stream().reduce(0, Integer::sum); }
public String[] invert() { int max = 0; for(int i : super.values()) { max = Math.max(max, i); } final String[] inverseMap = new String[max+1]; final ObjectIterator<Entry<String>> iter = super.object2IntEntrySet().fastIterator(); while(iter.hasNext()) { final Entry<String> entry = iter.next(); inverseMap[entry.getIntValue()] = entry.getKey(); } return inverseMap; }