Code example for SetMultimap

Methods: remove

0
    } 
     
    @Override 
    public void onItemRemoved(ItemType item) {
        ContainerType oldNode = itemToContainer.remove(item);
        if (oldNode != null && oldNode != NULL_CONTAINER) containerToItems.remove(oldNode, item);
        Double workrate = itemToWorkrate.remove(item);
        if (workrate != null)
            currentPoolWorkrate -= workrate;
        immovableItems.remove(item);
    } 
     
    @Override 
    public void onItemWorkrateUpdated(ItemType item, double newValue) {
        if (hasItem(item)) {
            Double oldValue = itemToWorkrate.put(item, newValue);
            double delta = ( newValue - (oldValue != null ? oldValue : 0) );
            currentPoolWorkrate += delta;
        } else { 
            // Can happen when item removed - get notification of removal and workrate from group and item