\seekquarry\yioop\executablesPageIterator

This class provides the same interface as an iterator over crawl mixes, but simply iterates over an array.

This is used to gather all of the pages for a training set in one go (using a crawl mix iterator), then repeatedly iterate over them in memory, as though they were coming from the original crawl mix iterator.

Summary

Methods
Properties
Constants
__construct()
reset()
nextPages()
nextPage()
$pages
$length
$pos
$end_of_iterator
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$pages

$pages : array

The array of pages to repeatedly iterate over.

Type

array

$length

$length : integer

The total number of pages.

Type

integer

$pos

$pos : integer

The current offset into the wrapped array.

Type

integer

$end_of_iterator

$end_of_iterator : boolean

Whether or not the last page has been reached.

Type

boolean

Methods

__construct()

__construct(array  $pages) 

Establishes a new iterator over a (potentially empty) array of pages.

Parameters

array $pages

standard array of pages to iterate over

reset()

reset() 

Resets the iterator so that the next page will be the first.

nextPages()

nextPages(integer  $n = -1) : array

Returns up to the requested number of next pages, potentially an empty array if there are no pages left. This method updates the `end_of_iterator' flag according to whether the last page has been returned.

Parameters

integer $n

maximum number of pages to return, or -1 to return all remaining pages

Returns

array —

next $n pages, or less if there are fewer than $n pages remaining

nextPage()

nextPage() : array

Behaves like nextPages, but returns just the next page (not wrapped in an array) if there is one, and null otherwise.

Returns

array —

next page if available, and null otherwise