Here you can find the source of print(Map
Parameter | Description |
---|---|
vehiclesMap | a parameter |
public static void print(Map<String, List<String>> map)
//package com.java2s; //License from project: Apache License import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; public class Main { /**//from w ww.j a v a 2s . co m * * @param vehiclesMap */ public static void print(Map<String, List<String>> map) { for (Iterator<Entry<String, List<String>>> iterator = map.entrySet().iterator(); iterator.hasNext();) { Map.Entry<String, List<String>> entry = (Map.Entry<String, List<String>>) iterator.next(); String key = entry.getKey(); List<String> values = entry.getValue(); System.out.println(key); for (String string : values) { System.out.println("\t" + string); } } // System.out.println("Lista: " + vehicles.size()); } }