Php/docs/class.cachingiterator
(PHP 5, PHP 7)
简介
This object supports cached iteration over another iterator.
类摘要
CachingIterator extends IteratorIterator implements OuterIterator , ArrayAccess , Countable {
const
int
CALL_TOSTRING
= 1
const
int
CATCH_GET_CHILD
= 16
const
int
TOSTRING_USE_KEY
= 2
const
int
TOSTRING_USE_CURRENT
= 4
const
int
TOSTRING_USE_INNER
= 8
const
int
FULL_CACHE
= 256
/* 方法 */
public __construct
( Iterator $iterator
[, int $flags
= self::CALL_TOSTRING
] )
public count ( ) : int
public getCache ( ) : array
public getFlags ( ) : int
public getInnerIterator ( ) : Iterator
public hasNext ( ) : void
public key ( ) : scalar
public next ( ) : void
public offsetExists
( mixed $index
) : void
public offsetGet
( string $index
) : void
public offsetUnset
( string $index
) : void
public rewind ( ) : void
public setFlags
( int $flags
) : void
public __toString ( ) : void
public valid ( ) : void
}
预定义常量
CachingIterator::CALL_TOSTRING
- Convert every element to string.
CachingIterator::CATCH_GET_CHILD
- Don't throw exception in accessing children.
CachingIterator::TOSTRING_USE_KEY
- Use key for conversion to string.
CachingIterator::TOSTRING_USE_CURRENT
- Use current for conversion to string.
CachingIterator::TOSTRING_USE_INNER
- Use inner for conversion to string.
CachingIterator::FULL_CACHE
- Cache all read data.
Table of Contents
- CachingIterator::__construct — Construct a new CachingIterator object for the iterator
- CachingIterator::count — The number of elements in the iterator
- CachingIterator::current — Return the current element
- CachingIterator::getCache — Retrieve the contents of the cache
- CachingIterator::getFlags — Get flags used
- CachingIterator::getInnerIterator — Returns the inner iterator
- CachingIterator::hasNext — Check whether the inner iterator has a valid next element
- CachingIterator::key — Return the key for the current element
- CachingIterator::next — Move the iterator forward
- CachingIterator::offsetExists — The offsetExists purpose
- CachingIterator::offsetGet — The offsetGet purpose
- CachingIterator::offsetSet — The offsetSet purpose
- CachingIterator::offsetUnset — The offsetUnset purpose
- CachingIterator::rewind — Rewind the iterator
- CachingIterator::setFlags — The setFlags purpose
- CachingIterator::__toString — Return the string representation of the current element
- CachingIterator::valid — Check whether the current element is valid
/* 常量 */