Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class Main {

    public static <V, T> List<Map.Entry<V, T>> MapToList(Map<V, T> map) {
        Set<Map.Entry<V, T>> set = map.entrySet();
        List<Map.Entry<V, T>> list = new ArrayList<Map.Entry<V, T>>();
        for (Iterator<Map.Entry<V, T>> it = set.iterator(); it.hasNext();) {
            Map.Entry<V, T> entry = it.next();
            list.add(entry);
        }
        return list;
    }
}