TTreeIterator

TIterator<TElement> that allows a depth-first iteration over a hierarchy of TElement.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TIterator<TElement>Abstract base class for facilities that allow iteration over elements of type TElement.
3TTreeIterator

Source

Iterator.Tree.pas (36)

Description

TTreeIterator<TElement> requires a Parent and a ChildIteratorFactory. The parent element is the root element of the iteration of the current subtree and this element will be returned first. For descending into the children of an element ChildIteratorFactory is used to create an iterator for the children of the current parent element. The created iterator should only return the direct children of the parent element. TTreeIterator<TElement> will then use the created child iterators to form a depth-first iteration of the entire tree rooted at Parent.

Fields

ScopeVisibilityTypeNameDescription
InstanceprotectedTElementParent
InstanceprotectedTTreeVerticalOrderOrder
InstanceprotectedTTreeIteratorStateState
InstanceprotectedTIterator<TElement>ChildIterator
InstanceprotectedTIterator<TElement>ChildSubtreeIterator
InstanceprotectedTChildIteratorFactory<TElement>ChildIteratorFactory

Methods

ScopeVisibilityResultNameDescription
InstanceprotectedTElementGetCurrent()
InstanceprotectedEnterCurrentChild(EndState: TTreeIteratorState)
InstancepublicCreate(Parent: TElement; Order: TTreeVerticalOrder; ChildIteratorFactory: TChildIteratorFactory<TElement>)
InstancepublicDestroy()
InstancepublicTBooleanIsValid()
InstancepublicGotoNext()