- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Java_Collection_Framework_Walker Zhang
Java Collections Framework Content Framework architecture Usage Idioms Genaral-purpose Implementations Wrapper and Convenience Implementations Apply algorithms through collections and arrays Interoperability Java Collection Framework A unified architecture for representing and manipulating collections. Interfaces Interface-based framework Implementations Algorithms polymorphic: the same method can be used on many different implementations of the appropriate collection interface. Interface Hierarchy A set of interfaces two interface trees The different interfaces describe the different types of groups Understand the interfaces, understand the framework how to use them - idioms Interfaces - foundation of the framework These interfaces allow collections to be manipulated independently of the details of their representation. The Collection interface is a group of objects, with duplicates allowed. The Set interface extends Collection but forbids duplicates. The List interface extends Collection, allows duplicates, and introduces positional indexing. The Map interface extends neither Set nor Collection. Interface: Collection Traversing a collections: By using the for-each construct read-only for Object o : collection System.out.println o ; By using Iterators: static void filter Collection ? c for Iterator ? it c.iterator ; it.hasNext ; if !cond it.next it.remove ; Idiom to remove all instances of a specified element: c.removeAll Collections.singleton e ; c.removeAll Collections.singleton null ; Array Operations: Object[] a c.toArray ; String[] a c.toArray new String[0] ; Interface: Set The Set interface contains only methods inherited from Collection Adds the restriction that duplicate elements are prohibited. Adds a stronger contract on the behavior of the equals and hashCode operations Two Set instances are equal if they contain the same elements. Set: Usage idioms 1 Idioms: conversion constructors Collection noDups new HashSet c ;
您可能关注的文档
- GMclass1.ppt
- grammar_survival_guide.doc
- grid codes are being set up in several countries by specifying the relevant requirements for efficie.doc
- GRR and Kappa V01.ppt
- GSD.ppt
- hbase ORM framework - Simplehbase Getting Started in 3 minutes v0.1.pptx
- Healthy Living.ppt
- helen.ppt
- HIGH-WATER MARK.doc
- HK_banking_-_regulatroy_framework.ppt
- 养老评估师中级行为面试题库及案例分析.docx
- 面试培训督导时考察其课程理解能力的题目.docx
- 税务专员面试中关于增值税政策的常见问题解答.docx
- 2025宁波市医疗保障局局属事业单位宁波市医疗保障基金管理中心招聘事业编制工作人员1人备考试题附答案.docx
- 2025咸宁市汉口银行咸宁嘉鱼支行招聘笔试历年题库附答案解析.docx
- 2025北京人才发展战略研究院招录笔试备考题库附答案.docx
- 2025四川成都市龙泉驿区青台山中学校秋季教师招聘22人笔试试题附答案解析.docx
- 2025台州市银龄讲学计划教师招募13人笔试参考试题附答案解析.docx
- 2025中国铁建公开招聘42人笔试题库附答案.docx
- 2025中智咨询研究院社会招聘笔试参考题库附答案.docx
原创力文档


文档评论(0)