From 8ef69cf369d13dc78d2cfdca64b109184daf3f75 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 30 Nov 2003 16:31:35 +0000 Subject: [PATCH] Update --- ext/spl/examples/filteriterator.inc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/spl/examples/filteriterator.inc b/ext/spl/examples/filteriterator.inc index 43f8515c2f..ac8236aa36 100755 --- a/ext/spl/examples/filteriterator.inc +++ b/ext/spl/examples/filteriterator.inc @@ -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(); /** -- 2.50.1