<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>迭代器模式 on 极客老墨</title>
    <link>https://blog.hankmo.com/tags/%E8%BF%AD%E4%BB%A3%E5%99%A8%E6%A8%A1%E5%BC%8F/</link>
    <description>Recent content in 迭代器模式 on 极客老墨</description>
    <generator>Hugo -- 0.138.0</generator>
    <language>zh-cn</language>
    <lastBuildDate>Tue, 11 Jan 2022 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.hankmo.com/tags/%E8%BF%AD%E4%BB%A3%E5%99%A8%E6%A8%A1%E5%BC%8F/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Java设计模式(22)-迭代器模式</title>
      <link>https://blog.hankmo.com/posts/architecture/java-iterator-pattern/</link>
      <pubDate>Tue, 11 Jan 2022 00:00:00 +0000</pubDate>
      <guid>https://blog.hankmo.com/posts/architecture/java-iterator-pattern/</guid>
      <description>生活中，存在这样的场景：需要逐个遍历一堆对象，然后判断对象是否符合要求，做出相应的处理。例如，乘火车时，检票员站在门口挨个检票，没有买票的人不能乘车。类似的场景还有很多，比如乘地铁、乘公交、从书架上找书、食堂排队打饭等等…… 我们把需要逐个遍历的这一堆对象称为对象集合，把挨个遍历的过程称为迭代。迭代时，如果能将迭代过程从对象集合中抽取出来单独实现，让对象集合只负责管理自身状态，而不用负担迭代的任务，这就减轻了对象集合的职责，这就是今天要说的——迭代器模式。</description>
    </item>
  </channel>
</rss>
