Java Map Remove removeColor(Map windowColorCountMap, int windowColorCount, int lastColor)

Here you can find the source of removeColor(Map windowColorCountMap, int windowColorCount, int lastColor)

Description

remove Color

License

Open Source License

Declaration

private static int removeColor(Map<Integer, Integer> windowColorCountMap, int windowColorCount, int lastColor) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    private static int removeColor(Map<Integer, Integer> windowColorCountMap, int windowColorCount, int lastColor) {
        boolean removedAColor = false;
        Integer colorCount = windowColorCountMap.get(lastColor);
        if (colorCount == 1)
            removedAColor = true;// w w w .ja  va 2s .  com
        windowColorCountMap.put(lastColor, colorCount - 1);
        return removedAColor ? windowColorCount - 1 : windowColorCount;
    }
}

Related

  1. removeAllFromCollection(Map> map, Object key, Collection values)
  2. removeAllNullValueEntry(Map source)
  3. removeAndCleanFromCollectionMap(KeyT key, ValT toBeRemoved, Map> map)
  4. removeApiUuidMap(String apiName)
  5. removeClassFromMap(final Map the_map, final String the_class_name)
  6. removeDefaultAnnotationPackage(final String packageName, final Map context)
  7. removeDoubleQuotes(Map argMap)
  8. removeElementFromJsonMap(Map toscaJson, String elementName)
  9. removeEmptyArray(Map map)