Class JTrees
- java.lang.Object
-
- org.nuiton.jaxx.runtime.swing.tree.JTrees
-
public class JTrees extends Object
Created by tchemit on 11/10/17.- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Constructor Summary
Constructors Constructor Description JTrees()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<TreeNode>breadthFirstStream(TreeNode node)Creates a stream of tree node using the Breadth-first search (BFS) algorithm with preorder vertex ordering starting on givennode.static Stream<TreeNode>breadthFirstStream(TreeNode node, boolean parallel)Creates a stream of tree node using the Breadth-first search (BFS) algorithm with preorder vertex ordering starting on givennode.static voidinitUI(JScrollPane selectedTreePane, JTree tree)static Stream<TreeNode>postorderStream(TreeNode node)Creates a stream of tree node using the Depth-first search (DSF) algorithm with postorder vertex ordering starting on givennode.static Stream<TreeNode>postorderStream(TreeNode node, boolean parallel)Creates a stream of tree node using the Depth-first search (DSF) algorithm with postorder vertex ordering starting on givennode.static Stream<TreeNode>preorderStream(TreeNode node)Creates a stream of tree node using the Depth-first search (DSF) algorithm with preorder vertex ordering starting on givennode.static Stream<TreeNode>preorderStream(TreeNode node, boolean parallel)Creates a stream of tree node using the Depth-first search (DSF) algorithm with preorder vertex ordering starting on givennode.
-
-
-
Method Detail
-
initUI
public static void initUI(JScrollPane selectedTreePane, JTree tree)
-
preorderStream
public static Stream<TreeNode> preorderStream(TreeNode node)
Creates a stream of tree node using the Depth-first search (DSF) algorithm with preorder vertex ordering starting on givennode.Note: the stream is not parallel.
- Parameters:
node- node ot walk through- Returns:
- stream of nodes in correct order.
-
preorderStream
public static Stream<TreeNode> preorderStream(TreeNode node, boolean parallel)
Creates a stream of tree node using the Depth-first search (DSF) algorithm with preorder vertex ordering starting on givennode.- Parameters:
node- node ot walk throughparallel- to set parallel on the stream- Returns:
- stream of nodes in correct order.
-
postorderStream
public static Stream<TreeNode> postorderStream(TreeNode node)
Creates a stream of tree node using the Depth-first search (DSF) algorithm with postorder vertex ordering starting on givennode.Note: the stream is not parallel.
- Parameters:
node- node ot walk through- Returns:
- stream of nodes in correct order.
-
postorderStream
public static Stream<TreeNode> postorderStream(TreeNode node, boolean parallel)
Creates a stream of tree node using the Depth-first search (DSF) algorithm with postorder vertex ordering starting on givennode.- Parameters:
node- node ot walk throughparallel- to set parallel on the stream- Returns:
- stream of nodes in correct order.
-
breadthFirstStream
public static Stream<TreeNode> breadthFirstStream(TreeNode node)
Creates a stream of tree node using the Breadth-first search (BFS) algorithm with preorder vertex ordering starting on givennode.Note: the stream is not parallel.
- Parameters:
node- node ot walk through- Returns:
- stream of nodes in correct order.
-
breadthFirstStream
public static Stream<TreeNode> breadthFirstStream(TreeNode node, boolean parallel)
Creates a stream of tree node using the Breadth-first search (BFS) algorithm with preorder vertex ordering starting on givennode.- Parameters:
node- node ot walk throughparallel- to set parallel on the stream- Returns:
- stream of nodes in correct order.
-
-