Java List Print printMap(HashMap> listHashMap)

Here you can find the source of printMap(HashMap> listHashMap)

Description

print Map

License

Open Source License

Declaration

protected static void printMap(HashMap<String, List<String>> listHashMap) 

Method Source Code


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

import java.util.*;

public class Main {
    protected static void printMap(HashMap<String, List<String>> listHashMap) {
        for (String s : listHashMap.keySet()) {
            System.out.print(s + ": [");
            for (String n : listHashMap.get(s)) {
                System.out.print(n + " ");
            }/*from   w  w w. j  a  v  a2  s  . c  o m*/
            System.out.print("]\n");
        }
    }

    protected static void print(HashMap<String, Integer> m) {
        System.out.println("HashMap:");
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            System.out.println("  " + e.getKey() + ":" + e.getValue());
        }
    }

    protected static void print(Set<String> s) {
        System.out.println("Set:");
        for (String str : s) {
            System.out.println("  " + str);
        }
    }
}

Related

  1. printListStrings(List list, String listDescription)
  2. printListV(List l)
  3. printListWithDelimiter(Collection list, String delimiter)
  4. println(List text)
  5. printlnList(List list)
  6. printNonEmptyList(List list)
  7. printObjectList(List list)
  8. printout(List record)
  9. printPerformanceStats(String message, List iterationTimesInNanoseconds)

  10. HOME | Copyright © www.java2s.com 2016