flex遍历HashMap

可以通过2种方法遍历HashMap

Map map = new HashMap();

for (Iterator iter = map.entrySet().iterator(); iter.hasNext();) {

    Map.Entry entry = (Map.Entry) iter.next();

    Object key = entry.getKey();

    Object val = entry.getValue();

}

或者:

Map map = new HashMap();

for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {

    Object key = iter.next();

    Object val = map.get(key);

}

 


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/E_wsq/archive/2008/04/29/2343194.aspx

你可能感兴趣的:(.net,Blog,Flex,Flash)