Here you can find the source of removeOutStringsStrings(Map
Parameter | Description |
---|---|
vehiclesMap | a parameter |
public static void removeOutStringsStrings(Map<String, String> map, String newString)
//package com.java2s; //License from project: Apache License import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; public class Main { /**/*from w ww . ja v a 2 s .c o m*/ * Remove um string da tabela de espalhamento caso seja igual ao parametro 'newString' * * @param vehiclesMap */ public static void removeOutStringsStrings(Map<String, String> map, String newString) { for (Iterator<Entry<String, String>> iterator = map.entrySet().iterator(); iterator.hasNext();) { Map.Entry<String, String> entry = (Map.Entry<String, String>) iterator.next(); String key = entry.getKey(); // List<String> value = entry.getValue(); if (key.equals(newString)) { iterator.remove(); } } // System.out.println("Lista: " + vehicles.size()); } }