-
- Type Parameters:
D
- is the type of the data inside the forest
- All Superinterfaces:
Collection<Tree<D,?>>
,Iterable<Tree<D,?>>
- All Known Implementing Classes:
AbstractForest
,ArrayForest
,LinkedForest
interface Forest<D> extends Collection<Tree<D,?>>
This is the generic definition of a forest of trees.A forest of trees is a collection of trees.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:41
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathtree
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Iterator<TreeNode<D,?>>
broadFirstIterator()
Replies a broad first iterator on nodes.Iterator<D>
dataBroadFirstIterator()
Replies the broad-first iterator on the tree.Iterator<D>
dataDepthFirstIterator()
Replies a prefixed depth first iterator on the tree.Iterator<D>
dataDepthFirstIterator(int infixPosition)
Replies the depth first iterator on the tree.Iterator<D>
dataDepthFirstIterator(DepthFirstNodeOrder nodeOrder)
Replies a depth first iterator on the tree.Iterator<TreeNode<D,?>>
depthFirstIterator()
Replies a depth-first iterator on nodes.Iterator<TreeNode<D,?>>
depthFirstIterator(DepthFirstNodeOrder nodeOrder)
Replies a depth-first iterator on nodes.int[]
getHeights()
Replies the heights of all the leaf nodes.int
getMaxHeight()
Replies the maximal height of the forest.int
getMinHeight()
Replies the minimal height of the forest.
-
-
-
Method Detail
-
getMinHeight
@Pure int getMinHeight()
Replies the minimal height of the forest.- Returns:
- the height of the uppest leaf in the forest.
-
getMaxHeight
@Pure int getMaxHeight()
Replies the maximal height of the forest.- Returns:
- the height of the lowest leaf in the forest.
-
getHeights
@Pure int[] getHeights()
Replies the heights of all the leaf nodes. The order of the heights is given by a depth-first iteration.- Returns:
- the heights of the leaf nodes
-
depthFirstIterator
@Pure Iterator<TreeNode<D,?>> depthFirstIterator(DepthFirstNodeOrder nodeOrder)
Replies a depth-first iterator on nodes.- Parameters:
nodeOrder
- indicates how the data are treated by the iterator.- Returns:
- a depth first iterator on nodes
-
depthFirstIterator
@Pure Iterator<TreeNode<D,?>> depthFirstIterator()
Replies a depth-first iterator on nodes.- Returns:
- a depth-first iterator.
-
broadFirstIterator
@Pure Iterator<TreeNode<D,?>> broadFirstIterator()
Replies a broad first iterator on nodes.- Returns:
- a broad first iterator.
-
dataDepthFirstIterator
@Pure Iterator<D> dataDepthFirstIterator()
Replies a prefixed depth first iterator on the tree.- Returns:
- a prefixed depth first iterator on data.
-
dataDepthFirstIterator
@Pure Iterator<D> dataDepthFirstIterator(DepthFirstNodeOrder nodeOrder)
Replies a depth first iterator on the tree.- Parameters:
nodeOrder
- indicates how the data are treated by the iterator.- Returns:
- an iterator on the data.
-
dataDepthFirstIterator
@Pure Iterator<D> dataDepthFirstIterator(int infixPosition)
Replies the depth first iterator on the tree.- Parameters:
infixPosition
- is the index at which the parent will be treated according to its child set.- Returns:
- the iterator on user data
- See Also:
InfixDepthFirstTreeIterator
-
-