[php]php设计模式 Interator (迭代器模式)

摘要: 1 <?php 2 /** 3 * 迭代器模式 4 * 5 * 提供一个方法顺序访问一聚合对象中的各个元素,而又不暴露对象的内部表示 6 */ 7 interface Interator 8 { 9 publicfunctionnext();10 publicfunction first();11 publicfunctioncurrent();12 publicfunction isDone();13 }14 15 class SomeInterator implements Interator16 {17 private$_arr=array();18 19 publicfunct. 阅读全文
posted @ 2011-06-29 21:59 bluefrog 阅读(1767) 评论(0) 推荐(0)