Dedian  
          -- 關注搜索引擎的開發
          日歷
          <2006年6月>
          28293031123
          45678910
          11121314151617
          18192021222324
          2526272829301
          2345678
          統計
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65577
          • 排名 - 817

          最新評論

          閱讀排行榜

          評論排行榜

           
          Unlike collection types such as Vector or List, Map (HashTable or HashMap) accesses a value by a key. If we want to retrieve all the values that have been put in a Map, one of simple ways to do that is employing a Collection or plus an Iterator, here is the sample code (just retrieve vaules, skip keys), assuming there is a variable: HashMap<String, <ComplexDataType>> links

          Collection c = links.value();
          Vector<ComplexDataType> v = new Vector<ComplexDataType>(c);
          for(int i = 0; i< v.size(); i++)
          {
          ??? ComplexDataType tempData = (ComplexDataType)v.get(i);
          ??? dosomethingwith(tempData);
          }


          P.S. Map provides three views of map: keySet, entrySet and values collection, we can use any of them .
          posted on 2006-06-02 07:16 Dedian 閱讀(342) 評論(0)  編輯  收藏 所屬分類: Java Memo
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 彭水| 河北区| 连江县| 左权县| 中山市| 昌宁县| 琼中| 台湾省| 勐海县| 长沙县| 永清县| 松溪县| 定襄县| 达州市| 阿尔山市| 黄龙县| 福鼎市| 平安县| 北宁市| 那坡县| 太和县| 江北区| 武威市| 大石桥市| 恩平市| 扶风县| 湘西| 潞城市| 通化市| 依安县| 临猗县| 柳林县| 深水埗区| 偏关县| 吉木萨尔县| 龙游县| 社会| 和顺县| 临高县| 望奎县| 民勤县|