ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Worksheet_CellIterator Class Reference
+ Inheritance diagram for PHPExcel_Worksheet_CellIterator:
+ Collaboration diagram for PHPExcel_Worksheet_CellIterator:

Public Member Functions

 __construct (PHPExcel_Worksheet $subject=null, $rowIndex=1)
 Create a new cell iterator.
 __destruct ()
 Destructor.
 rewind ()
 Rewind iterator.
 current ()
 Current PHPExcel_Cell.
 key ()
 Current key.
 next ()
 Next value.
 valid ()
 More PHPExcel_Cell instances available?
 getIterateOnlyExistingCells ()
 Get loop only existing cells.
 setIterateOnlyExistingCells ($value=true)
 Set loop only existing cells.

Private Attributes

 $_subject
 $_rowIndex
 $_position = 0
 $_onlyExistingCells = true

Detailed Description

Definition at line 38 of file CellIterator.php.

Constructor & Destructor Documentation

PHPExcel_Worksheet_CellIterator::__construct ( PHPExcel_Worksheet  $subject = null,
  $rowIndex = 1 
)

Create a new cell iterator.

Parameters
PHPExcel_Worksheet$subject
int$rowIndex

Definition at line 74 of file CellIterator.php.

{
// Set subject and row index
$this->_subject = $subject;
$this->_rowIndex = $rowIndex;
}
PHPExcel_Worksheet_CellIterator::__destruct ( )

Destructor.

Definition at line 83 of file CellIterator.php.

{
unset($this->_subject);
}

Member Function Documentation

PHPExcel_Worksheet_CellIterator::current ( )

Current PHPExcel_Cell.

Returns
PHPExcel_Cell

Definition at line 99 of file CellIterator.php.

{
return $this->_subject->getCellByColumnAndRow($this->_position, $this->_rowIndex);
}
PHPExcel_Worksheet_CellIterator::getIterateOnlyExistingCells ( )

Get loop only existing cells.

Returns
boolean

Definition at line 149 of file CellIterator.php.

References $_onlyExistingCells.

PHPExcel_Worksheet_CellIterator::key ( )

Current key.

Returns
int

Definition at line 108 of file CellIterator.php.

References $_position.

{
}
PHPExcel_Worksheet_CellIterator::next ( )

Next value.

Definition at line 115 of file CellIterator.php.

References $_position.

PHPExcel_Worksheet_CellIterator::rewind ( )

Rewind iterator.

Definition at line 90 of file CellIterator.php.

{
$this->_position = 0;
}
PHPExcel_Worksheet_CellIterator::setIterateOnlyExistingCells (   $value = true)

Set loop only existing cells.

Returns
boolean

Definition at line 158 of file CellIterator.php.

{
$this->_onlyExistingCells = $value;
}
PHPExcel_Worksheet_CellIterator::valid ( )

More PHPExcel_Cell instances available?

Returns
boolean

Definition at line 124 of file CellIterator.php.

References $_position, and PHPExcel_Cell\columnIndexFromString().

{
// columnIndexFromString() returns an index based at one,
// treat it as a count when comparing it to the base zero
// position.
$columnCount = PHPExcel_Cell::columnIndexFromString($this->_subject->getHighestColumn());
if ($this->_onlyExistingCells) {
// If we aren't looking at an existing cell, either
// because the first column doesn't exist or next() has
// been called onto a nonexistent cell, then loop until we
// find one, or pass the last column.
while ($this->_position < $columnCount &&
!$this->_subject->cellExistsByColumnAndRow($this->_position, $this->_rowIndex)) {
}
}
return $this->_position < $columnCount;
}

+ Here is the call graph for this function:

Field Documentation

PHPExcel_Worksheet_CellIterator::$_onlyExistingCells = true
private

Definition at line 66 of file CellIterator.php.

Referenced by getIterateOnlyExistingCells().

PHPExcel_Worksheet_CellIterator::$_position = 0
private

Definition at line 59 of file CellIterator.php.

Referenced by key(), next(), and valid().

PHPExcel_Worksheet_CellIterator::$_rowIndex
private

Definition at line 52 of file CellIterator.php.

PHPExcel_Worksheet_CellIterator::$_subject
private

Definition at line 45 of file CellIterator.php.


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