prperties的遍历有点麻烦,map的遍历有entrySet和迭代,foreach等,但这些都是有迹可循的。以下是个完整的方法,包含两者的遍历,已经经过本人测试。当然实现方法可以有很多,我的观点是能用,好用,则不拘一格。
public static void putHashCCde(Properties prop) {
Enumeration en = prop.propertyNames();
while (en.hasMoreElements()) {
String key = (String) (en.nextElement());
// System.out.println(prop.getProperty(en.nextElement()));
String str = prop.getProperty(key);
String[] icode = new String[19];
icode = str.trim().split(",");
hashChineseCode.put(key, icode);
}
for (Map.Entry<String, String[]> entry : hashChineseCode.entrySet())
{
String[] a = entry.getValue();
for (int j = 0; j < a.length; j++) {
System.out.print(a[j]+",");
if(j==a.length-1){
System.out.println();
}
}
}
}
分享到:
相关推荐
组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种...
8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 ...
组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 ...
8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 ...
9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种...
9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种...
9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种...
8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 ...
8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 ...
hide() 和 show() 都可以设置两个可选参数:speed 和 callback。 语法: $(selector).hide(speed,callback) $(selector).show(speed,callback) speed 参数规定显示或隐藏的速度。可以设置这些值:"slow", "fast", ...