|
SPL-StandardPHPLibrary
|


Public Member Functions | |
| __call ($func, $params) | |
| __construct (Iterator $it) | |
| accept () | |
| current () | |
| getInnerIterator () | |
| key () | |
| next () | |
| rewind () | |
| valid () | |
Protected Member Functions | |
| __clone () | |
| fetch () | |
Private Attributes | |
| $it | |
Abstract filter for iterators.
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.
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.
Definition at line 26 of file filteriterator.inc.
| FilterIterator::__construct | ( | Iterator | $it | ) |
Constructs a filter around another iterator.
| it | Iterator to filter |
Definition at line 35 of file filteriterator.inc.
References $it.
| FilterIterator::__call | ( | $func, | |
| $params | |||
| ) |
Aggregate the inner iterator.
| func | Name of method to invoke |
| params | Array of parameters to pass to method |
Definition at line 121 of file filteriterator.inc.
|
protected |
|
abstract |
Accept function to decide whether an element of the inner iterator should be accessible through the Filteriterator.
Referenced by fetch().
| FilterIterator::current | ( | ) |
Implements Iterator.
Definition at line 97 of file filteriterator.inc.
Referenced by RegexFindFile\accept(), and FindFile\accept().
|
protected |
Fetch next element and store it.
Definition at line 61 of file filteriterator.inc.
References accept().
Referenced by next(), and rewind().

| FilterIterator::getInnerIterator | ( | ) |
Implements OuterIterator.
Definition at line 111 of file filteriterator.inc.
References $it.
Referenced by SearchIterator\__call(), DirectoryFilterDots\accept(), KeyFilter\accept(), RecursiveRegexIterator\getChildren(), RecursiveFilterIterator\getChildren(), RecursiveRegexIterator\hasChildren(), RecursiveFilterIterator\hasChildren(), and DirectoryFilterDots\key().
| FilterIterator::key | ( | ) |
Implements Iterator.
Definition at line 90 of file filteriterator.inc.
Referenced by KeyFilter\accept().
| FilterIterator::next | ( | ) |
Move to next element.
Implements Iterator.
Definition at line 75 of file filteriterator.inc.
References fetch().

| FilterIterator::rewind | ( | ) |
Rewind the inner iterator.
Implements Iterator.
Definition at line 42 of file filteriterator.inc.
References fetch().

| FilterIterator::valid | ( | ) |
Implements Iterator.
Definition at line 83 of file filteriterator.inc.
|
private |
Definition at line 28 of file filteriterator.inc.
Referenced by FindFile\__construct(), __construct(), and getInnerIterator().
1.8.5