ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_Worksheet_ColumnIterator Class Reference
+ Inheritance diagram for PHPExcel_Worksheet_ColumnIterator:
+ Collaboration diagram for PHPExcel_Worksheet_ColumnIterator:

Public Member Functions

 __construct (PHPExcel_Worksheet $subject=null, $startColumn='A', $endColumn=null)
 Create a new column iterator. More...
 
 __destruct ()
 Destructor. More...
 
 resetStart ($startColumn='A')
 
 resetEnd ($endColumn=null)
 
 seek ($column='A')
 
 rewind ()
 Rewind the iterator to the starting column. More...
 
 current ()
 Return the current column in this worksheet. More...
 
 key ()
 Return the current iterator key. More...
 
 next ()
 Set the iterator to its next value. More...
 
 prev ()
 
 valid ()
 Indicate if more columns exist in the worksheet range of columns that we're iterating. More...
 

Private Attributes

 $_subject
 
 $_position = 0
 
 $_startColumn = 0
 
 $_endColumn = 0
 

Detailed Description

Definition at line 38 of file ColumnIterator.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Worksheet_ColumnIterator::__construct ( PHPExcel_Worksheet  $subject = null,
  $startColumn = 'A',
  $endColumn = null 
)

Create a new column iterator.

Parameters
PHPExcel_Worksheet$subjectThe worksheet to iterate over
string$startColumnThe column address at which to start iterating
string$endColumnOptionally, the column address at which to stop iterating

Definition at line 77 of file ColumnIterator.php.

77 {
78 // Set subject
79 $this->_subject = $subject;
80 $this->resetEnd($endColumn);
81 $this->resetStart($startColumn);
82 }

References resetEnd(), and resetStart().

+ Here is the call graph for this function:

◆ __destruct()

PHPExcel_Worksheet_ColumnIterator::__destruct ( )

Destructor.

Definition at line 87 of file ColumnIterator.php.

87 {
88 unset($this->_subject);
89 }

Member Function Documentation

◆ current()

PHPExcel_Worksheet_ColumnIterator::current ( )

Return the current column in this worksheet.

Returns
PHPExcel_Worksheet_Column

Definition at line 147 of file ColumnIterator.php.

147 {
148 return new PHPExcel_Worksheet_Column($this->_subject, PHPExcel_Cell::stringFromColumnIndex($this->_position));
149 }
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
Definition: Cell.php:825

References PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ key()

PHPExcel_Worksheet_ColumnIterator::key ( )

Return the current iterator key.

Returns
string

Definition at line 156 of file ColumnIterator.php.

156 {
157 return PHPExcel_Cell::stringFromColumnIndex($this->_position);
158 }

References PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ next()

PHPExcel_Worksheet_ColumnIterator::next ( )

Set the iterator to its next value.

Definition at line 163 of file ColumnIterator.php.

References $_position.

◆ prev()

PHPExcel_Worksheet_ColumnIterator::prev ( )
Set the iterator to its previous value
Exceptions
PHPExcel_Exception

Definition at line 172 of file ColumnIterator.php.

172 {
173 if ($this->_position <= $this->_startColumn) {
174 throw new PHPExcel_Exception(
175 "Column is already at the beginning of range (" .
176 PHPExcel_Cell::stringFromColumnIndex($this->_endColumn) . " - " .
177 PHPExcel_Cell::stringFromColumnIndex($this->_endColumn) . ")"
178 );
179 }
180
182 }

References $_position, and PHPExcel_Cell\stringFromColumnIndex().

+ Here is the call graph for this function:

◆ resetEnd()

PHPExcel_Worksheet_ColumnIterator::resetEnd (   $endColumn = null)
(Re)Set the end column

@param string       $endColumn      The column address at which to stop iterating
Returns
PHPExcel_Worksheet_ColumnIterator

Definition at line 111 of file ColumnIterator.php.

111 {
112 $endColumn = ($endColumn) ? $endColumn : $this->_subject->getHighestColumn();
113 $this->_endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
114
115 return $this;
116 }
static columnIndexFromString($pString='A')
Column index from string.
Definition: Cell.php:782

References PHPExcel_Cell\columnIndexFromString().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetStart()

PHPExcel_Worksheet_ColumnIterator::resetStart (   $startColumn = 'A')
(Re)Set the start column and the current column pointer

@param integer      $startColumn    The column address at which to start iterating
Returns
PHPExcel_Worksheet_ColumnIterator

Definition at line 97 of file ColumnIterator.php.

97 {
98 $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
99 $this->_startColumn = $startColumnIndex;
100 $this->seek($startColumn);
101
102 return $this;
103 }

References PHPExcel_Cell\columnIndexFromString(), and seek().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rewind()

PHPExcel_Worksheet_ColumnIterator::rewind ( )

Rewind the iterator to the starting column.

Definition at line 138 of file ColumnIterator.php.

138 {
139 $this->_position = $this->_startColumn;
140 }

References $_startColumn.

◆ seek()

PHPExcel_Worksheet_ColumnIterator::seek (   $column = 'A')
Set the column pointer to the selected column

@param string       $column The column address to set the current pointer at
Returns
PHPExcel_Worksheet_ColumnIterator
Exceptions
PHPExcel_Exception

Definition at line 125 of file ColumnIterator.php.

125 {
127 if (($column < $this->_startColumn) || ($column > $this->_endColumn)) {
128 throw new PHPExcel_Exception("Column $column is out of range ({$this->_startColumn} - {$this->_endColumn})");
129 }
130 $this->_position = $column;
131
132 return $this;
133 }
$column
Definition: 39dropdown.php:62

References $column, and PHPExcel_Cell\columnIndexFromString().

Referenced by resetStart().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valid()

PHPExcel_Worksheet_ColumnIterator::valid ( )

Indicate if more columns exist in the worksheet range of columns that we're iterating.

Returns
boolean

Definition at line 189 of file ColumnIterator.php.

189 {
190 return $this->_position <= $this->_endColumn;
191 }

References $_endColumn.

Field Documentation

◆ $_endColumn

PHPExcel_Worksheet_ColumnIterator::$_endColumn = 0
private

Definition at line 67 of file ColumnIterator.php.

Referenced by valid().

◆ $_position

PHPExcel_Worksheet_ColumnIterator::$_position = 0
private

Definition at line 52 of file ColumnIterator.php.

Referenced by next(), and prev().

◆ $_startColumn

PHPExcel_Worksheet_ColumnIterator::$_startColumn = 0
private

Definition at line 59 of file ColumnIterator.php.

Referenced by rewind().

◆ $_subject

PHPExcel_Worksheet_ColumnIterator::$_subject
private

Definition at line 45 of file ColumnIterator.php.


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