@Override public int remove(K k) { int rv = counts.remove(k); sumOfCounts -= rv; return rv; }
/** * Updates the co-occurrence map based on the current click of the user * @param session - */ protected void updateMap(List<Transaction> session) { for (int i = 0; i < session.size() - 1; i++) { if (getCoOccurrenceKey(session.get(i)) == getCoOccurrenceKey(session.get(session.size()-1))) { // ignore co-occurrences of items with themselves continue; } // we add one entry to the map with the "correct" order (time-based) addTuple(session.get(i), session.get(session.size()-1)); // map with opposite order addTuple(session.get(session.size()-1), session.get(i)); } //if we are supposed to only look at the last N clicks, //this part of the method checks the buffer and cleans out old clicks. if(buffer){ while(ringBuffer.size()>bufferSize){ //adjust map Entry<String, String> first = ringBuffer.poll(); Object2IntOpenHashMap<String> map = coOcurrenceMap.get(first.getKey()); map.addTo(first.getValue(), -1); map.remove(first.getValue(), 0);//remove if 0 } } }
size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary();
size--; garbageSize++; dictionary.remove(node.getId()); trimDictionary();
dictionary.remove(edge.getId()); trimDictionary();
dictionary.remove(edge.getId()); trimDictionary();