Class TreePreOrderIterable<TItem, TIdentifier>
java.lang.Object
de.xima.fc.workflow.TreePreOrderIterable<TItem, TIdentifier>
- Type Parameters:
TItem- Type of the items in the tree.TIdentifier- Type of the identifier that identifiers the items in the tree.
- All Implemented Interfaces:
Iterable<TItem>
@Deprecated
public final class TreePreOrderIterable<TItem, TIdentifier>
extends Object
implements Iterable<TItem>
Deprecated.
An iterable that iterates over a tree-like graph in pre-order, starting at a given node. Throws an exception in case
the graph is not a tree, thus also preventing endless cycles when the graph is cyclic.
Assume the following tree:
- a
- a1
- a2
- a21
- a22
- b
- b1
- b2
Then a pre-order traversal traverses the nodes in the following order:
- a
- a1
- a2
- a21
- a22
- b
- b1
- b2
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionTreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.Returns a new iterable over the items in the tree starting at the given item.TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.Returns a new iterable over the items in the tree starting at the given item.TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.UseTreePreOrderIterable(Iterable, ITreeAccessor)instead.TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.Returns a new iterable over the items in the tree starting at the given item.TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.Returns a new iterable over the items in the tree starting at the given item.TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.UseTreePreOrderIterable(Object, ITreeAccessor)instead.TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.UseTreePreOrderIterable(Object, ITreeAccessor, boolean)instead. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
TreePreOrderIterable
public TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItems- Root items where to start the traversal. These items are included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifier
-
TreePreOrderIterable
public TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItems- Root items where to start the traversal. These items are included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifierlimitRecursion- Iftrue, stops iterating when an item is encountered for the second time (as determined byObject.hashCode(),Object.equals(Object)) and throws anIllegalStateException.- Since:
- 7.2.1
-
TreePreOrderIterable
Deprecated.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItem- Item where to start the traversal. This item is included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifier
-
TreePreOrderIterable
public TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItem- Item where to start the traversal. This item is included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifierlimitRecursion- Iftrue, stops iterating when an item is encountered for the second time (as determined byObject.hashCode(),Object.equals(Object)) and throws anIllegalStateException.- Since:
- 7.2.1
-
TreePreOrderIterable
@Deprecated public TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.UseTreePreOrderIterable(Iterable, ITreeAccessor)instead.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItems- Root items where to start the traversal. These items are included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifier
-
TreePreOrderIterable
@Deprecated public TreePreOrderIterable(Iterable<TItem> startItems, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItems- Root items where to start the traversal. These items are included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifierlimitRecursion- Iftrue, stops iterating when an item is encountered for the second time (as determined byObject.hashCode(),Object.equals(Object)) and throws anIllegalStateException.- Since:
- 7.2.1
-
TreePreOrderIterable
@Deprecated public TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor) Deprecated.UseTreePreOrderIterable(Object, ITreeAccessor)instead.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItem- Item where to start the traversal. This item is included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifier
-
TreePreOrderIterable
@Deprecated public TreePreOrderIterable(TItem startItem, ITreeAccessor<TItem, TIdentifier> treeAccessor, boolean limitRecursion) Deprecated.UseTreePreOrderIterable(Object, ITreeAccessor, boolean)instead.Returns a new iterable over the items in the tree starting at the given item.- Parameters:
startItem- Item where to start the traversal. This item is included in the traversal.treeAccessor- Handler for accessing the children of a node, and its identifierlimitRecursion- Iftrue, stops iterating when an item is encountered for the second time (as determined byObject.hashCode(),Object.equals(Object)) and throws anIllegalStateException.- Since:
- 7.2.1
-
-
Method Details
-
iterator
-
toList
Deprecated.Iterates over the node and its children, and returns a list of all iterated nodes.- Type Parameters:
TItem- Type of the items in the tree.- Parameters:
startItem- Node where to start the traversal. This item is included in the returned list.treeAccessor- Handler for accessing the children of a node, and its identifier.- Returns:
- A list with the given start item and all its children.
-
TreeIteration