Buffer
        
        extends IteratorIterator
    
    
            
            in package
            
        
    
            
            implements
                            Outer                    
    
    
Class \Hoa\Iterator\Buffer.
Buffer iterator: Can go backward up to a certain limit, and forward.
Tags
Table of Contents
Interfaces
- Outer
- Interface \Hoa\Iterator\Outer.
Constants
- BUFFER_KEY = 0
- Buffer key index.
- BUFFER_VALUE = 1
- Buffer value index.
Properties
- $_buffer : SplDoublyLinkedList
- Buffer.
- $_bufferSize : int
- Maximum buffer size.
- $_iterator : Iterator
- Current iterator.
Methods
- __construct() : mixed
- Construct.
- current() : mixed
- Return the current element.
- getBufferSize() : int
- Get buffer size.
- getInnerIterator() : Iterator
- Get inner iterator.
- key() : mixed
- Return the key of the current element.
- next() : void
- Move forward to next element.
- previous() : void
- Move backward to previous element.
- rewind() : void
- Rewind the iterator to the first element.
- valid() : bool
- Check if current position is valid.
- getBuffer() : SplDoublyLinkedList
- Get buffer.
Constants
BUFFER_KEY
Buffer key index.
    public
        mixed
    BUFFER_KEY
    = 0
    
    
    
    Tags
BUFFER_VALUE
Buffer value index.
    public
        mixed
    BUFFER_VALUE
    = 1
    
    
    
    Tags
Properties
$_buffer
Buffer.
    protected
        SplDoublyLinkedList
    $_buffer
     = null
    
    
    
    
$_bufferSize
Maximum buffer size.
    protected
        int
    $_bufferSize
     = 1
    
    
    
    
$_iterator
Current iterator.
    protected
        Iterator
    $_iterator
     = null
    
    
    
    
Methods
__construct()
Construct.
    public
                    __construct(Iterator $iterator, int $bufferSize) : mixed
    Parameters
- $iterator : Iterator
- 
                    Iterator. 
- $bufferSize : int
- 
                    Buffer size. 
current()
Return the current element.
    public
                    current() : mixed
    getBufferSize()
Get buffer size.
    public
                    getBufferSize() : int
    Return values
intgetInnerIterator()
Get inner iterator.
    public
                    getInnerIterator() : Iterator
    Return values
Iteratorkey()
Return the key of the current element.
    public
                    key() : mixed
    next()
Move forward to next element.
    public
                    next() : void
    previous()
Move backward to previous element.
    public
                    previous() : void
    rewind()
Rewind the iterator to the first element.
    public
                    rewind() : void
    valid()
Check if current position is valid.
    public
                    valid() : bool
    Return values
boolgetBuffer()
Get buffer.
    protected
                    getBuffer() : SplDoublyLinkedList