- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
DS2
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * An Inner Class Iterator View class (查看类型) LinkedListWithIterator(迭代的链表) Note methods declared in interface Iterator(注意接口迭代中声明的方法) Found within inner class IteratorForLinkedList(在内部类型迭代列表中查找) This inner class has data field nextNode to track an iteration(此内部类型有数据域nextNode来跟踪某个迭代) nextNode references the node that method next must access( nextNode引用那些必须访问的节点 ) An Inner Class Iterator Fig. 8-7 An inner class iterator with direct access to the linked chain that implements the ADT(一个能够直接访问某个抽象数据类型的链接链的迭代) An Array-Based Implementation(基于数组的实现) View outline of ArrayListWithIterator(查看列表阵列迭代的大纲) Note methods required for the inner class(注意内部类型所需要的方法) hasNext next remove An Array-Based Implementation Fig 8-8 The array of list entries and nextIndex (a) just before to the call to next(数组列表和nextIndex 之前调用下一个) An Array-Based Implementation Fig 8-8 The array of list entries and nextIndex (b) just after the call to next but before the call to remove(列表项的数组和nextIndex(二)后的下一个呼叫,但在调用之前删除 ) An Array-Based Implementation Fig 8-8 The array of list entries and nextIndex (c) after the call to remove((c)在数组列表条目和nextIndex调用删除) Why are Iterator Methods in Their Own Class?(为什么用他们自己的迭代方法) Consider modification of linked implementations of list(考虑修改列表的链接实现) Include the methods specified in Java interface Iterator(包括说明java接口迭代的方法) Method remove not included for simplicity(为了简单起见,删除方法不被包括) View outline of ListWithTraversal(查看ListWithTraversal的大纲) Note similarities and differences with Listing(注意与排列的异同) Why are Iterator Methods in Their Own Class? Note that traversal methods do execute quickly(注意遍历法执行的很快) Direct access to underlying data structure(直接访问底层的数据结构) But …(但是…) Only one traversal can be in progress at a time(在一次执行过程中只能进行仅一次遍历) Resulting ADT requires too many operations (interface bloat)(结果抽象数据类型要求太多的操作(接口臃肿)) The Interface ListIterator An alternative interface for iterators in Java Class Library(用来替代java类型库中迭代的接口) E
您可能关注的文档
最近下载
- 1小纸条 高考成语三千 日积月累记练(测试版)001-025 (1).docx
- 《法理学》课件(第五章:法律关系).ppt VIP
- 2025年自习室市场用户付费意愿与自习室服务质量提升策略分析.docx
- 生物安全法的试题及答案.docx VIP
- 《全大学进阶英语综合教程3》Unit-4教案.pdf VIP
- 单句语法填空专项训练100题(基础知识)(解析版).docx VIP
- 法理学第五章 法律关系.ppt VIP
- 专题02 数轴中的动点问题的七种考法(原卷版)【2025数学常考压轴题上册七年级北师版】.docx VIP
- BP85956D_CN_DS_Rev.0.91 规格书晶丰明源家电电源.pdf VIP
- 思想道德与法治(23版):第六章 学习法治思想 提升法治素养.pptx
文档评论(0)