From 592ee79fc1d13c4904e1ccc2746045e9c2ed12fd Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 6 May 2004 21:20:50 +0000 Subject: [PATCH] - Update documentation --- ext/spl/spl.php | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/ext/spl/spl.php b/ext/spl/spl.php index d5c274e687..e211322ee1 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -12,7 +12,9 @@ * foreach construct and do not need to implement IteratorAggregate or * Iterator. * - * \note This is an engine internal interface. + * \note This is an engine internal interface which cannot be implemented + * in PHP scripts. Either IteratorAggregate or Iterator must be used + * instead. */ interface Traversable { @@ -24,7 +26,7 @@ interface Traversable */ interface IteratorAggregate implements Traversable { - /** Return an Iterator for the implementing object. + /** \return an Iterator for the implementing object. */ function getIterator(); } @@ -72,9 +74,11 @@ interface RecursiveIterator implements Iterator function getChildren(); } -/** Class for recursive traversal. The objects of this class are created by - * instances of RecursiveIterator. Elements of those iterators may be - * traversable themselves. If so these sub elements are recursed into. +/** \brief Class for recursive traversal. + * + * The objects of this class are created by instances of RecursiveIterator. + * Elements of those iterators may be traversable themselves. If so these + * sub elements are recursed into. */ class RecursiveIteratorIterator implements Iterator { @@ -153,6 +157,11 @@ class ArrayObject implements IteratorAggregate, ArrayAccess * returns an array of the public properties. */ function getArrayCopy(); + + /** \return the number of elements in the array or the number of public + * properties in the object. + */ + function count(); } /** \brief An Array iterator @@ -209,8 +218,19 @@ class ArrayIterator implements Iterator, SeekableIterator, ArrayAccess */ function seek($position); -/** Iterator that wrapps around another iterator and only returns selected - * elements of the inner iterator. + /** \return the number of elements in the array or the number of public + * properties in the object. + */ + function count(); +} + +/** \brief An iterator that filters other iterators + * + * Iterator that wrapps around another iterator and only returns selected + * elements of the inner iterator. The only thing that needs to be done to + * make this work is implementing method accept(). Typically this invloves + * reading the current element or key of the inner Iterator and checking + * whether it is acceptable. */ abstract class FilterIterator implements Iterator { -- 2.40.0