/** * Returns the number of active connections for this selector manager * * @return number of active connections. */ public Integer getNumActiveConnections() { return numActiveConnections.toInteger(); }
@Override public String toString() { return super.toString() + String.format("[%s, %s]", this.tc.toString(), this.mi.toInteger()); } }
@Override public void endWindow() { for (Map.Entry<String, MutableInt> e: map.entrySet()) { counts.emit(new KeyValPair<>(e.getKey(), e.getValue().toInteger())); } map.clear(); } }
/** * Emits only the keys and values changed or added in a given window. */ @Override public void endWindow() { HashMap<K, Integer> tuple = new HashMap<>(); for (K key: inputSet) { tuple.put(key, map.get(key).toInteger()); } if (!tuple.isEmpty()) { count.emit(tuple); } if (!cumulative) { map.clear(); } inputSet.clear(); }
/** * Returns topN objects * @param n * @return Top N in an ArrayList */ @SuppressWarnings({ "rawtypes", "unchecked" }) public ArrayList getTopN(int n) { ArrayList list = new ArrayList(); E v; int j = 0; while (((v = q.poll()) != null) && j < n) { list.add(v); j++; } ArrayList<HashMap<E,Integer>> ret = new ArrayList<HashMap<E,Integer>>(list.size()); int size = list.size(); int depth = size; if (depth > n) { depth = n; } for (int i = 0; i < depth; i++) { E o = (E)list.get(size - i - 1); HashMap<E, Integer> val = new HashMap<E, Integer>(1); MutableInt ival = hmap.get(o); val.put(o, ival.toInteger()); ret.add(val); } return ret; }
ctuples.put(key, c.toInteger());
ctuples.put(key, c.toInteger());
vc.getAlleles().stream().forEach(a -> result.set(a, alleleCounts.get(a).toInteger()));
int count = entry.getValue().toInteger();
public Integer answer() throws Throwable { return value.toInteger();