VirtualArrayIterator Class Reference
[Db]

Provides paging and iteration for "virtual" arrays -- arrays for which only the current "page" is available, but are much bigger in entirety. More...

Inheritance diagram for VirtualArrayIterator:

ItemIterator

List of all members.

Public Member Functions

 atFirstPage ()
 atLastPage ()
 eof ()
 getCount ()
 getPage ()
 getPageCount ()
next ()
nextWithKey ()
toArray ()
 VirtualArrayIterator (&$theArray, $totalItems, $page=-1, $itemsPerPage=-1)
 wasEmpty ()


Detailed Description

Provides paging and iteration for "virtual" arrays -- arrays for which only the current "page" is available, but are much bigger in entirety.

Definition at line 21 of file VirtualArrayIterator.inc.php.


Member Function Documentation

VirtualArrayIterator.atFirstPage (  ) 

Check whether or not this iterator is for the first page of a sequence

Returns:
boolean

Reimplemented from ItemIterator.

Definition at line 88 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.atLastPage (  ) 

Check whether or not this iterator is for the last page of a sequence

Returns:
boolean

Reimplemented from ItemIterator.

Definition at line 96 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.eof (  ) 

Return a boolean indicating whether or not we've reached the end of results Note: This implementation requires that next() be called before every eof() will function properly (except the first call).

Returns:
boolean

Reimplemented from ItemIterator.

Definition at line 130 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.getCount (  ) 

Get the total number of items in the virtual array

Returns:
int

Reimplemented from ItemIterator.

Definition at line 112 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.getPage (  ) 

Get the page number that this iterator represents

Returns:
int

Reimplemented from ItemIterator.

Definition at line 104 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.getPageCount (  ) 

Get the total number of pages in the virtual array

Returns:
int

Reimplemented from ItemIterator.

Definition at line 120 of file VirtualArrayIterator.inc.php.

& VirtualArrayIterator.next (  ) 

Return the next item in the iterator.

Returns:
object

Reimplemented from ItemIterator.

Definition at line 62 of file VirtualArrayIterator.inc.php.

Referenced by nextWithKey().

& VirtualArrayIterator.nextWithKey (  ) 

Return the next item in the iterator, with key.

Returns:
array (key, value)

Reimplemented from ItemIterator.

Definition at line 78 of file VirtualArrayIterator.inc.php.

References next().

& VirtualArrayIterator.toArray (  ) 

Convert the iterator into an array

Returns:
array

Reimplemented from ItemIterator.

Definition at line 146 of file VirtualArrayIterator.inc.php.

VirtualArrayIterator.VirtualArrayIterator ( &$  theArray,
totalItems,
page = -1,
itemsPerPage = -1 
)

Constructor.

Parameters:
$theArray array The array of items to iterate through
$totalItems int The total number of items in the virtual "larger" array
$page int the current page number
$itemsPerPage int Number of items to display per page

Definition at line 44 of file VirtualArrayIterator.inc.php.

References wasEmpty().

VirtualArrayIterator.wasEmpty (  ) 

Return a boolean indicating whether or not this iterator was empty from the beginning

Returns:
boolean

Reimplemented from ItemIterator.

Definition at line 138 of file VirtualArrayIterator.inc.php.

Referenced by VirtualArrayIterator().


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:49 2008 for Open Journal Systems by  doxygen 1.5.6