Code example for SetMultimap

Methods: putremove

0
                    "if onItemAdded subsequently received will get new container then", item, newNode);
            return; 
        } 
        ContainerType newNodeNonNull = toNonNullContainer(newNode);
        ContainerType oldNode = itemToContainer.put(item, newNodeNonNull);
        if (oldNode != null && oldNode != NULL_CONTAINER) containerToItems.remove(oldNode, item);
        if (newNode != null) containerToItems.put(newNode, item);
    } 
     
    @Override 
    public void onContainerAdded(ContainerType newContainer, double lowThreshold, double highThreshold) {
        boolean added = containers.add(newContainer);
        if (!added) {
            // See LoadBalancingPolicy.onContainerAdded for possible explanation of why can get duplicate calls 
            LOG.debug("Duplicate container-added event for {}; ignoring", newContainer);
            return; 
        } 
        containerToLowThreshold.put(newContainer, lowThreshold);
        containerToHighThreshold.put(newContainer, highThreshold);
        poolLowThreshold += lowThreshold;
Experience pair programming with AI  Get Codota for Java