@SuppressWarnings("unchecked") public List<T> getSortedItems() { List<T> keys = new ArrayList<>(); for (Object key : this.counts.keys()) keys.add((T) key); Collections.sort(keys, comparator); return keys; }
@SuppressWarnings("unchecked") public List<T> getSortedItems() { List<T> keys = new ArrayList<>(); for (Object key : this.counts.keys()) keys.add((T) key); Collections.sort(keys, comparator); return keys; }
/** * create a copy of this Counter * @return */ public Counter<T> copy() { Counter<T> copy = new Counter<T>(); for (Object key : this.counts.keys()) copy.incrementCount((T) key, this.counts.get(key)); return copy; } }
/** * create a copy of this Counter * @return */ public Counter<T> copy() { Counter<T> copy = new Counter<T>(); for (Object key : this.counts.keys()) copy.incrementCount((T) key, this.counts.get(key)); return copy; } }
writer.newLine(); String[] keys = map.keys(new String[map.size()]); if (sortByValues) { List<Tuple<String, Double>> list = new LinkedList<>();
@SuppressWarnings("unchecked") public Pair<T, Double> getMin() { for (Object k : counts.keys()) { argMin.update((T) k, counts.get(k)); } return new Pair<>(this.argMin.getArgmin(), this.argMin.getMinValue()); }
@SuppressWarnings("unchecked") public Pair<T, Double> getMax() { for (Object k : counts.keys()) { argMax.update((T) k, counts.get(k)); } return new Pair<>(this.argMax.getArgmax(), this.argMax.getMaxValue()); }
@SuppressWarnings("unchecked") public Pair<T, Double> getMin() { for (Object k : counts.keys()) { argMin.update((T) k, counts.get(k)); } return new Pair<>(this.argMin.getArgmin(), this.argMin.getMinValue()); }
@SuppressWarnings("unchecked") public Pair<T, Double> getMax() { for (Object k : counts.keys()) { argMax.update((T) k, counts.get(k)); } return new Pair<>(this.argMax.getArgmax(), this.argMax.getMaxValue()); }