MapUtils.java :  » Music » jfugue » org » jfugue » util » Java Open Source

Java Open Source » Music » jfugue 
jfugue » org » jfugue » util » MapUtils.java
package org.jfugue.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public final class MapUtils {

  /**
   * No instances.
   */
  private MapUtils() {}
  
  public static <T> Map<T, T> convertArrayToImutableMap(T[][] array) {
    Map<T, T> map = new HashMap<T, T>(array.length);
    for (T[] ts : array) {
      map.put(ts[0], ts[1]);
    }
    return Collections.unmodifiableMap(map);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.