📄 mapfactory.java
字号:
package com.reddragon2046.base.utilities.data.util;
import java.util.Map;
public class MapFactory
{
public MapFactory()
{
}
public static Map create(Class mapClass)
{
try
{
return (Map)mapClass.newInstance();
}
catch(Exception e)
{
throw new RuntimeException("error creating Map of type " + mapClass + ":" + e.getLocalizedMessage());
}
}
public static Map create(Class mapClass, Object values[])
{
Map map = create(mapClass);
for(int i = 0; i < values.length; i++)
map.put(new Integer(i), values[i]);
return map;
}
public static Map createCopy(Map m)
{
Map copy = create(m.getClass());
copy.putAll(m);
return copy;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -