MCPcopy Create free account
hub / github.com/WinVector/Logistic / observe

Method observe

src/com/winvector/util/CountMap.java:28–35  ·  view source on GitHub ↗

Invariant: key set calls all keys ever observed (even those with net-zero count) @param key @param delta

(final T key, final double delta)

Source from the content-addressed store, hash-verified

26 * @param delta
27 */
28 public void observe(final T key, final double delta) {
29 MutableDouble v = counts.get(key);
30 if(v==null) {
31 v = new MutableDouble();
32 counts.put(key,v);
33 }
34 v.v += delta;
35 }
36
37 public void observe(final CountMap<T> o) {
38 for(final T k: o.keySet()) {

Callers 1

readCountMapMethod · 0.95

Calls 2

getMethod · 0.45
keySetMethod · 0.45

Tested by

no test coverage detected