TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection:
TYPO3\CMS\Backend\Tree\TreeNodeCollection t3lib_tree_SortedNodeCollection

Public Member Functions

 contains (\TYPO3\CMS\Backend\Tree\TreeNode $node)
 
 append (\TYPO3\CMS\Backend\Tree\TreeNode $node)
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Tree\TreeNodeCollection
 __construct (array $data=array())
 
 asort ()
 
 nodeCompare (\TYPO3\CMS\Backend\Tree\TreeNode $node, \TYPO3\CMS\Backend\Tree\TreeNode $otherNode)
 
 serialize ()
 
 unserialize ($serializedString)
 
 toArray ()
 
 dataFromArray ($data)
 

Protected Member Functions

 offsetOf (\TYPO3\CMS\Backend\Tree\TreeNode $node)
 
 binarySearch (\TYPO3\CMS\Backend\Tree\TreeNode $node, $start, $end)
 
 normalize ()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Sorted Tree Node Collection

Note: This collection works only with integers as offset keys and not with much datasets. You have been warned!

Author
Stefan Galinski stefa.nosp@m.n.ga.nosp@m.linsk.nosp@m.i@gm.nosp@m.ail.c.nosp@m.om
Steffen Ritter info@.nosp@m.stef.nosp@m.fen-r.nosp@m.itte.nosp@m.r.net

Definition at line 25 of file SortedTreeNodeCollection.php.

Member Function Documentation

◆ append()

TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection::append ( \TYPO3\CMS\Backend\Tree\TreeNode  $node)

Adds a node to the internal list in a sorted approach

Parameters
\TYPO3\CMS\Backend\Tree\TreeNode$node
Returns
void

Definition at line 95 of file SortedTreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\TreeNodeCollection\asort(), and TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\normalize().

◆ binarySearch()

TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection::binarySearch ( \TYPO3\CMS\Backend\Tree\TreeNode  $node,
  $start,
  $end 
)
protected

Binary search that returns the offset of a given node

Parameters
\TYPO3\CMS\Backend\Tree\TreeNode$node
integer$start
integer$end
Returns
integer

Definition at line 55 of file SortedTreeNodeCollection.php.

Referenced by TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\offsetOf().

◆ contains()

TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection::contains ( \TYPO3\CMS\Backend\Tree\TreeNode  $node)

Checks if a specific node is inside the collection

Parameters
\TYPO3\CMS\Backend\Tree\TreeNode$node
Returns
boolean

Definition at line 33 of file SortedTreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\offsetOf().

◆ normalize()

TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection::normalize ( )
protected

Normalizes the array by reordering the keys

Returns
void

Definition at line 81 of file SortedTreeNodeCollection.php.

Referenced by TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\append().

◆ offsetOf()

TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection::offsetOf ( \TYPO3\CMS\Backend\Tree\TreeNode  $node)
protected

Returns the offset key of given node

Parameters
\TYPO3\CMS\Backend\Tree\TreeNode$node
Returns
int

Definition at line 43 of file SortedTreeNodeCollection.php.

References TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\binarySearch().

Referenced by TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection\contains().