[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/libs/ -> MappedIterator.php (summary)

Convenience class for generating iterators from iterators. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Author: Aaron Schulz
File Size: 117 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MappedIterator:: (8 methods):
  __construct()
  next()
  rewind()
  accept()
  key()
  valid()
  current()
  init()


Class: MappedIterator  - X-Ref

Convenience class for generating iterators from iterators.

__construct( $iter, $vCallback, array $options = array()   X-Ref
Build an new iterator from a base iterator by having the former wrap the
later, returning the result of "value" callback for each current() invocation.
The callback takes the result of current() on the base iterator as an argument.
The keys of the base iterator are reused verbatim.

An "accept" callback can also be provided which will be called for each value in
the base iterator (post-callback) and will return true if that value should be
included in iteration of the MappedIterator (otherwise it will be filtered out).

param: Iterator|Array $iter
param: callable $vCallback Value transformation callback
param: array $options Options map (includes "accept") (since 1.22)

next()   X-Ref
No description

rewind()   X-Ref
No description

accept()   X-Ref
No description

key()   X-Ref
No description

valid()   X-Ref
No description

current()   X-Ref
No description

init()   X-Ref
Obviate the usual need for rewind() before using a FilterIterator in a manual loop




Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1