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.Map.Entry;

public class Main {

    public static <T extends Object> List<T> map2list(Map<String, T> maps) {
        List<T> list = new ArrayList<T>();
        Iterator<Entry<String, T>> iterator = maps.entrySet().iterator();
        while (iterator.hasNext()) {
            Entry<String, T> entry = iterator.next();
            list.add(entry.getValue());
        }
        return list;
    }
}