# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 11:43:05 2018
@author: mz
"""
class Iterator(object):
def Next(self):
pass
def HasNext(self):
pass
def First(self):
pass
def Forward(self):
pass
class CocreteIterator(Iterator):
def __init__(self, aggregate):
self._aggregate = aggregate
def Next(self):
return self._aggregate.Next()
def HasNext(self):
return self._aggregate.HasNext()
def First(self):
return self._aggregate.First()
def Forward(self):
return self._aggregate.Forward()
class Aggregate(object):
def CreateIterator(self):
pass
def Next(self):
pass
def HasNext(self):
pass
def First(self):
pass
def Attach(self, obj):
pass
def Forward(self):
pass
class ConcreteAggregate(objec
Python 迭代模式
最新推荐文章于 2023-06-21 14:53:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)