/** * Return overall number of correct answers */ public int getCorrect() { return correctGuesses.totalIntCount(); }
public int getRetrieved() { return foundGuessed.totalIntCount(); }
public int getRelevant() { return foundCorrect.totalIntCount(); }
public double totalDoubleCount(Predicate<E> filter) { return totalIntCount(filter); }
public void remove(K1 key) { IntCounter<K2> counter = map.get(key); if (counter != null) { total -= counter.totalIntCount(); } map.remove(key); }
/** * replace the counter for K1-index o by new counter c */ public IntCounter<K2> setCounter(K1 o, IntCounter<K2> c) { IntCounter<K2> old = getCounter(o); total -= old.totalIntCount(); map.put(o, c); total += c.totalIntCount(); return old; }
/** */ public int totalCount(K1 k1) { IntCounter<K2> c = getCounter(k1); return c.totalIntCount(); }
private static <E> void appendIntCountStats(StringBuilder sb, String label, IntCounter<E> counts) { sb.append(label).append("\n"); List<E> sortedKeys = Counters.toSortedList(counts); int total = counts.totalIntCount(); for (E key:sortedKeys) { int count = counts.getIntCount(key); appendFrac(sb, key.toString(), count, total); sb.append("\n"); } }
private static <E> void appendIntCountStats(StringBuilder sb, String label, IntCounter<E> counts) { sb.append(label).append("\n"); List<E> sortedKeys = Counters.toSortedList(counts); int total = counts.totalIntCount(); for (E key:sortedKeys) { int count = counts.getIntCount(key); appendFrac(sb, key.toString(), count, total); sb.append("\n"); } }
public void subtractAll(K1 key, IntCounter<K2> c) { IntCounter<K2> myInner = getCounter(key); Counters.subtractInPlace(myInner, c); total -= c.totalIntCount(); }
public void addAll(K1 key, IntCounter<K2> c) { IntCounter<K2> myInner = getCounter(key); Counters.addInPlace(myInner, c); total += c.totalIntCount(); }
public void addAll(TwoDimensionalIntCounter<K1, K2> c) { for (K1 key : c.firstKeySet()) { IntCounter<K2> inner = c.getCounter(key); IntCounter<K2> myInner = getCounter(key); Counters.addInPlace(myInner, inner); total += inner.totalIntCount(); } }
public void subtractAll(TwoDimensionalIntCounter<K1, K2> c, boolean removeKeys) { for (K1 key : c.firstKeySet()) { IntCounter<K2> inner = c.getCounter(key); IntCounter<K2> myInner = getCounter(key); Counters.subtractInPlace(myInner, inner); if (removeKeys) { Counters.retainNonZeros(myInner); } total -= inner.totalIntCount(); } }
/** * Return overall number of correct answers */ public int getCorrect() { return correctGuesses.totalIntCount(); }
public void remove(K1 key) { IntCounter<K2> counter = map.get(key); if (counter != null) { total -= counter.totalIntCount(); } map.remove(key); }
/** */ public int totalCount(K1 k1) { IntCounter<K2> c = getCounter(k1); return c.totalIntCount(); }
private static <E> void appendIntCountStats(StringBuilder sb, String label, IntCounter<E> counts) { sb.append(label).append("\n"); List<E> sortedKeys = Counters.toSortedList(counts); int total = counts.totalIntCount(); for (E key:sortedKeys) { int count = counts.getIntCount(key); appendFrac(sb, key.toString(), count, total); sb.append("\n"); } }
private static <E> void appendIntCountStats(StringBuilder sb, String label, IntCounter<E> counts) { sb.append(label).append("\n"); List<E> sortedKeys = Counters.toSortedList(counts); int total = counts.totalIntCount(); for (E key:sortedKeys) { int count = counts.getIntCount(key); appendFrac(sb, key.toString(), count, total); sb.append("\n"); } }
public void subtractAll(K1 key, IntCounter<K2> c) { IntCounter<K2> myInner = getCounter(key); Counters.subtractInPlace(myInner, c); total -= c.totalIntCount(); }
public void addAll(K1 key, IntCounter<K2> c) { IntCounter<K2> myInner = getCounter(key); Counters.addInPlace(myInner, c); total += c.totalIntCount(); }