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

          導(dǎo)航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 66091
          • 排名 - 813

          最新評論

          閱讀排行榜

          評論排行榜

           
          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 閱讀(347) 評論(0)  編輯  收藏 所屬分類: Java Memo
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 肇源县| 郸城县| 化隆| 冷水江市| 万安县| 城口县| 潞城市| 芜湖市| 武川县| 新郑市| 乳山市| 旬阳县| 新疆| 叶城县| 彩票| 亚东县| 天水市| 黄浦区| 东阳市| 永安市| 任丘市| 平谷区| 中方县| 东海县| 油尖旺区| 同心县| 新建县| 莫力| 湟源县| 漯河市| 汉中市| 巴彦县| 济源市| 金阳县| 伊春市| 金乡县| 营山县| 莎车县| 吉木萨尔县| 大埔县| 儋州市|