Class SmartCachingIterator (namespace Nette)


Smarter caching interator.

CachingIterator
   |
   --SmartCachingIterator

Implements interfaces:

Countable (internal interface)
Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /SmartCachingIterator.php (line 35)
Public Method Summary
SmartCachingIterator
__construct ($iterator)
int
count ()
Returns the count of elements.
int
Returns the counter.
mixed
Returns the next key.
mixed
Returns the next element.
bool
isEmpty ()
Is the iterator empty?
bool
isEven ()
Is the counter even?
bool
isFirst ()
Is the current element the first one?
bool
isLast ()
Is the current element the last one?
bool
isOdd ()
Is the counter odd?
void
next ()
Forwards to the next element.
void
rewind ()
Rewinds the Iterator.
mixed
__call (string $name, array $args)
Call to undefined method.
& mixed
__get (string $name)
Returns property value. Do not call directly.
bool
__isset (string $name)
Is property defined?
void
__set (string $name, mixed $value)
Sets value of a property. Do not call directly.
void
__unset (string $name)
Access to undeclared property.
Methods Inherited From CachingIterator (Internal Class)
constructor __construct ( $iterator, [$flags = ] ), count ( ), current ( ), getCache ( ), getFlags ( ), getInnerIterator ( ), hasNext ( ), key ( ), next ( ), offsetExists ( $index ), offsetGet ( $index ), offsetSet ( $index, $newval ), offsetUnset ( $index ), rewind ( ), setFlags ( $flags ), valid ( ), __toString ( )
Constant Summary
Constants Inherited From CachingIterator (Internal Class)
CALL_TOSTRING = 1, CATCH_GET_CHILD = 16, FULL_CACHE = 256, TOSTRING_USE_CURRENT = 4, TOSTRING_USE_INNER = 8, TOSTRING_USE_KEY = 2

Method Details

line 42

__construct

public SmartCachingIterator __construct ($iterator)

Input
$iterator
Output
SmartCachingIterator  

line 130

count

public int count ()

Returns the count of elements.

Implementation of:

Countable::count
Output
int  

line 119

getCounter

public int getCounter ()

Returns the counter.

Output
int  

line 173

getNextKey

public mixed getNextKey ()

Returns the next key.

Output
mixed  

line 184

getNextValue

public mixed getNextValue ()

Returns the next element.

Output
mixed  

line 86

isEmpty

public bool isEmpty ()

Is the iterator empty?

Output
bool  

line 108

isEven

public bool isEven ()

Is the counter even?

Output
bool  

line 64

isFirst

public bool isFirst ()

Is the current element the first one?

Output
bool  

line 75

isLast

public bool isLast ()

Is the current element the last one?

Output
bool  

line 97

isOdd

public bool isOdd ()

Is the counter odd?

Output
bool  

line 147

next

public void next ()

Forwards to the next element.

Output
void  

line 161

rewind

public void rewind ()

Rewinds the Iterator.

Output
void  

line 203

__call

public mixed __call (string $name, array $args)

Call to undefined method.

Input
string $name method name
array $args arguments
Output
mixed  
Throws
throws MemberAccessException

line 217

__get

public mixed & __get (string $name)

Returns property value. Do not call directly.

Input
string $name property name
Output
& mixed property value
Throws
throws MemberAccessException if the property is not defined.

line 245

__isset

public bool __isset (string $name)

Is property defined?

Input
string $name property name
Output
bool  

line 232

__set

public void __set (string $name, mixed $value)

Sets value of a property. Do not call directly.

Input
string $name property name
mixed $value property value
Output
void  
Throws
throws MemberAccessException if the property is not defined or is read-only

line 259

__unset

public void __unset (string $name)

Access to undeclared property.

Input
string $name property name
Output
void  
Throws
throws MemberAccessException