Java Array to Map toMap(T[][] ts)

Here you can find the source of toMap(T[][] ts)

Description

to Map

License

BSD License

Declaration

public static <T> HashMap<T, T> toMap(T[][] ts) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.util.*;

public class Main {
    public static <T> HashMap<T, T> toMap(T[][] ts) {
        HashMap<T, T> out = new HashMap<T, T>(ts.length);
        for (int i = 0; i < ts.length; i++)
            out.put(ts[i][0], ts[i][1]);
        return out;
    }//from  w  w  w.  j  a  v  a2 s  .c om
}

Related

  1. toMap(String[] keys)
  2. toMap(String[]... wordMappings)
  3. toMap(String[][] checksumsArray)
  4. toMap(String[][] strings)
  5. toMap(T[][] pairs)