Questions tagged [treepath]

TreePath represents an array of objects that uniquely identify the path to a node in a tree. The elements of the array are ordered with the root as the first element of the array.

TreePath represents an array of objects that uniquely identify the path to a node in a tree. The elements of the array are ordered with the root as the first element of the array.

For example, a file on the file system is uniquely identified based on the array of parent directories and the name of the file. The path /tmp/foo/bar could be represented by a TreePath as new TreePath(new Object[] {"tmp", "foo", "bar"}).

9 questions
6
votes
3 answers

Progressively store the path from root node to node of multiway tree during insertion so that the storage operation does not have a complexity of O(n)

I would like to ask if someone knows a performant way to store the path from the root node to a new node of a multiway tree during the insertion of the new node. E.g., if I have the following tree: For each node, I currently store an array of the…
tonix
  • 6,671
  • 13
  • 75
  • 136
2
votes
0 answers

How to collect all the paths from sklearn decision tree?

I'm trying to generate all the paths from a decision tree in skealrn. The estimator here came from random forest, and it's a decision tree in sklearn. But I got confused by the data structure of sklearn decision tree. It seems that left, right here…
Cherry Wu
  • 3,844
  • 9
  • 43
  • 63
2
votes
1 answer

Support for JTree nodes with identical children

I have implemented a TreeModel to adapt an existing data model for visualization as a JTree. I have hit a problem with nodes that have multiple identical child (leaf) nodes. For example, consider a JTree with leaf nodes which are Strings. There is a…
ags
  • 719
  • 7
  • 23
1
vote
1 answer

How to programmatically set selection on a jTree child

I've read through a bunch of questions already asked but haven't see an solid answer yet. I'm trying to set the selection on a jTree in an attempt to create a sort of API for my Java project. I can set selection on a parent node easily with…
John Verber
  • 745
  • 2
  • 16
  • 31
1
vote
1 answer

JTree is displaying nodes that should be expandable as leaf nodes

I have this project where my program fetches files from a operating system disk image and stores their details in a database and another functionality fetches the files from the database and stores them in a List (my own object type) and is supposed…
Aayush Pathak
  • 159
  • 11
1
vote
1 answer

JTree node editing path comparison always true

I've been working on a file server program for a while, and thus far I've been able to avoid posting something here for help. But I cannot find anything on my problem and I am very confused. I've added a popup menu with the option to create new top…
0
votes
1 answer

Counting all nodes of all paths from root to leaves

If given a tree with nodes with integers: 1 ~ 10, and branching factor of 3 for all nodes, how can I write a function that traverses through the tree counting from root to leaves for EVERY paths So for this example, let's say it needs to return…
Charlie Baker
  • 81
  • 1
  • 2
  • 7
0
votes
1 answer

when is the filter(Viewer,TreePath,Object[]) method called?

I have created and added a new filter to my TreeViewer object. It works fine but I cannot seem to understand when is the filter(Viewer,TreePath,Object[]) called. So the filter is actually an instance of a class which extends ViewerFilter and needs…
Sterpu Mihai
  • 486
  • 1
  • 4
  • 15
-1
votes
2 answers

Javascript - Traverse A Tree To Generate The Sequence Of The Nodes

I have found few SO questions relevant to this but none of them were based on the exact problem I am trying to solve. Basically, I am working on a tree structure and every node is assigned an id. The objective is to generate a sequence string that…
planet_hunter
  • 3,866
  • 1
  • 26
  • 39