]> granicus.if.org Git - php/commitdiff
Update
authorMarcus Boerger <helly@php.net>
Sun, 30 Nov 2003 16:31:35 +0000 (16:31 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 30 Nov 2003 16:31:35 +0000 (16:31 +0000)
ext/spl/examples/filteriterator.inc

index 43f8515c2f1f7f9303840ad1a386b1d5b95306a7..ac8236aa3644b7de0b8581657ea4e53adf0c8a2d 100755 (executable)
@@ -5,10 +5,9 @@
  * @author  Marcus Boerger
  * @version 1.0
  *
- * Instances of this class act as a filter around iterators whose elements
- * are strings. In other words you can put an iterator into the constructor
- * and the instance will only return elements which match the given regular 
- * expression.
+ * Instances of this class act as a filter around iterators. In other words 
+ * you can put an iterator into the constructor and the instance will only 
+ * return selected (accepted) elements.
  */
 abstract class FilterIterator implements Iterator
 {
@@ -20,17 +19,26 @@ abstract class FilterIterator implements Iterator
         * method is called.
         *
         * @param it     Object that implements at least spl_forward
-        * @patam regex  Regular expression used as a filter.
         */
        function __construct(Iterator $it) {
                $this->it = $it;
        }
 
+       /**
+        * Rewind the inner iterator.
+        */
        function rewind() {     
                $this->it->rewind();
                $this->fetch();
        }
 
+       /**
+        * Accept function to decide whether an element of the inner iterator
+        * should be accessible through the Filteriterator.
+        *
+        * @return whether or not to expose the current element of the inner
+        *         iterator.
+        */
        abstract function accept();
 
        /**