Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • ArrayUtil
  • CountableLimitIterator
  • FilterIterator
  • MapIterator
  • Object
  • ObjectCache

Interfaces

  • ArrayCopy
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class MapIterator

Iterator which applies a callback over results (lazy-loaded calls). Supports iteration over both \Traversable and array.

Jyxo\Spl\MapIterator implements Countable, Jyxo\Spl\ArrayCopy, OuterIterator, SeekableIterator
Namespace: Jyxo\Spl
Category: Jyxo
Package: Jyxo\Spl
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Jakub Tománek
Located at Spl/MapIterator.php
Methods summary
public
# __construct( array|Iterator|IteratorAggregate $data, callback|Closure $map )

Constructor.

Constructor.

Parameters

$data
array|Iterator|IteratorAggregate
Source data
$map
callback|Closure
Applied callback or closure

Throws

InvalidArgumentException
Invalid source data or callback is not callable
public integer
# count( )

Returns count of source data.

Returns count of source data.

Returns

integer

Implementation of

Countable::count
public
# rewind( )

Rewinds the iterator to the beginning.

Rewinds the iterator to the beginning.

Implementation of

Iterator::rewind
public
# next( )

Advances the internal pointer.

Advances the internal pointer.

Implementation of

Iterator::next
public boolean
# valid( )

Returns if current pointer position is valid.

Returns if current pointer position is valid.

Returns

boolean

Implementation of

Iterator::valid
public mixed
# current( )

Returns current data.

Returns current data.

Returns

mixed

Implementation of

Iterator::current
public integer
# key( )

Returns current key.

Returns current key.

Returns

integer

Implementation of

Iterator::key
public array
# toArray( )

Returns all data as an array.

Returns all data as an array.

Returns

array

Implementation of

Jyxo\Spl\ArrayCopy::toArray
public Iterator
# getInnerIterator( )

Returns inner iterator (works even when constructed with array data)

Returns inner iterator (works even when constructed with array data)

Returns

Iterator

Implementation of

OuterIterator::getInnerIterator
public
# seek( integer $position )

Seeks to defined position. Does NOT throw \OutOfBoundsException.

Seeks to defined position. Does NOT throw \OutOfBoundsException.

Parameters

$position
integer
New position

Implementation of

SeekableIterator::seek
Jyxo PHP Library API documentation generated by ApiGen 2.3.0