Class FormItemIterator
- java.lang.Object
-
- com._1c.g5.v8.dt.form.service.item.FormItemIterator
-
public class FormItemIterator extends Object implements Iterator<FormItem>
The iterator for round of all a form items. Items in form object are structured as tree with respect thereto iterator has two search strategy:-
FormItemIterator.SearchStrategy.BreadthFirst
- it is Breadth-first search algorithm for tree. It starts at the tree root and explores the neighbor nodes first, before moving to the next level neighbors. -
FormItemIterator.SearchStrategy.DepthFirst
- it is Depth-first search algorithm for tree. One starts at the root and explores as far as possible along each branch before backtracking.
FormItemIterator
), and overridecreateSearchStrategy()
method. -
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
FormItemIterator.ISearchStrategy
The search strategy is provider for iterator on current step.static class
FormItemIterator.SearchStrategy
The enumerator of search strategy type for a default form item iterator
-
Field Summary
Fields Modifier and Type Field Description protected Iterator<FormItem>
current
protected FormItem
currentItem
protected LinkedList<Iterator<FormItem>>
iterators
protected FormItemIterator.ISearchStrategy
strategy
-
Constructor Summary
Constructors Constructor Description FormItemIterator(FormItemContainer container)
Creates a new form item iterator, with default(FormItemIterator.SearchStrategy.BreadthFirst
) search strategyFormItemIterator(FormItemContainer container, FormItemIterator.SearchStrategy strategy)
Creates a new form item iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Iterator<FormItem>
computationItemIterator(Object item)
The method creates sub iterator (if it is necessary) for item object.protected FormItemIterator.ISearchStrategy
createSearchStrategy()
Create a search strategy.boolean
hasNext()
FormItem
next()
void
remove()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
strategy
protected final FormItemIterator.ISearchStrategy strategy
-
iterators
protected final LinkedList<Iterator<FormItem>> iterators
-
currentItem
protected FormItem currentItem
-
-
Constructor Detail
-
FormItemIterator
public FormItemIterator(FormItemContainer container)
Creates a new form item iterator, with default(FormItemIterator.SearchStrategy.BreadthFirst
) search strategy- Parameters:
container
- the root element
-
FormItemIterator
public FormItemIterator(FormItemContainer container, FormItemIterator.SearchStrategy strategy)
Creates a new form item iterator.- Parameters:
container
- the root elementstrategy
- the search strategy, seeFormItemIterator.SearchStrategy
-
-
Method Detail
-
createSearchStrategy
protected FormItemIterator.ISearchStrategy createSearchStrategy()
Create a search strategy. The default form item iterator implementation can creates two types of search : Depth-first and Breadth-first.- Returns:
- the search strategy. see
FormItemIterator.ISearchStrategy
-
-