国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Java.until.Map,Set,List的資料整理

2019-11-18 13:14:50
字體:
來源:轉載
供稿:網友

  1.CollecitonFramework(J2SDK1.4 )一般用途Class作方式
  
 Java.until.Map,Set,List的資料整理(圖一)


  2.Collection Framework(J2SDK 1.4)一般用途Class特色與食用范圍比較
  
Java.until.Map,Set,List的資料整理(圖二)

  Collections => Collection是所有List跟Set的始祖,List必須以特定次序來持有對象,Set無法擁有重復元素
  
  ArrayList => 用Array實做的List,答應快速隨機存取,相較于LinkedList 不適合拿來進行元素安插和移除動作
  LinkedList => 提供最佳循序存取,適合安插和移除元素,隨機存取動作比起ArrayList緩慢
  
  HashSet => 是一種collection,但是只存放唯一值,是把搜尋時間看的很重要的set,用hash方式實作的set,故access time complexity = O(1)
  
  TreeSet => 同上,但是存入的元素都會經過排列,所以速度比HashSet 慢一點
  
  LinkedHashSet =>
  Performance is likely to be just slightly below that of HashSet, due to the added eXPense of maintaining the linked list, with one exception: Iteration over a LinkedHashSet requires time PRoportional to the size of the set, regardless of its capacity. Iteration over a HashSet is likely to be more expensive, requiring time proportional to its capacity.
  
  BitSet => 能夠高效率的儲存大量 [ 1 / 0 ] (開/關) 資料
  
  HashMap => 用來取代HashTable,儲存 (key/value) pairs
  TreeMap => 儲存 (key/value) pairs,會自動根據Key值排序
  
  LinkedHashMap =>
  Performance is likely to be just slightly below that of HashMap, due to the added expense of maintaining the linked list, with one exception: Iteration over the collection-views of a LinkedHashMap requires time proportional to the size of the map, regardless of its capacity. Iteration over a HashMap is likely to be more expensive, requiring time proportional to its capacity.
  
  IdentityHashMap =>
  This has better locality for large tables than does using separate arrays.) For many JRE implementations and Operation mixes, this class will yield better performance than HashMap (which uses chaining rather than linear-probing
  
  WeakHashMap => 這個map中,由于每個Value僅存在一個實體,因而節省了儲存空間,一但程序需要某個Value,便在map中搜尋既有的對象,并使用找到的那個對象(而非重新再造一個),由于這是一種節省儲存空間的技巧,所以能夠方便的讓GC自動清理Key和Value,一但Key不在被使用,便會觸發清理動作
  
  容器簡介
  1.容器的分類
  1.1.Collection:一組各自獨立的元素,即其內的每個位置僅持有一個元素。
  1)List:以元素安插的次序來放置元素,不會重新排列。
  2)Set:不接愛重復元素,它會使用自己內部的一個排列機制
  1.2.Map:一群成對的key-value對象,即所持有的是key-value pairs。
  Map中不能有重復的key,它擁有自己的內部排列機制。
  2.容器中的元素類型都為Object。從容器取得元素時,必須把它轉換成原來的類型。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 安宁市| 西盟| 洛阳市| 隆化县| 阳谷县| 五峰| 外汇| 平江县| 军事| 贡山| 长子县| 桦川县| 扶绥县| 那坡县| 新田县| 永新县| 东乌珠穆沁旗| 香港| 渝北区| 临湘市| 万安县| 宝鸡市| 荣成市| 宜兰市| 吴旗县| 清涧县| 宁南县| 昌乐县| 成都市| 阳春市| 柳江县| 福州市| 拜泉县| 山西省| 张北县| 弥勒县| 泽库县| 休宁县| 察雅县| 武乡县| 宕昌县|