jiweigang1 / google-collections

Automatically exported from code.google.com/p/google-collections
Apache License 2.0
0 stars 0 forks source link

TreeMaper #187

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Similar to a MapMaper. 
It builds a tree using a Function<T child, T parent>.

The Tree interface does not exist yet, AFAIK. 

Original issue reported on code.google.com by zeitlin...@gmail.com on 10 Jun 2009 at 7:43

GoogleCodeExporter commented 9 years ago
What's the problem with using a map/function for bottom-to-top tree, and a 
multimap for 
top-to-bottom?

Original comment by jim.andreou on 10 Jun 2009 at 7:55

GoogleCodeExporter commented 9 years ago
As a result I want to have a tree structure that is build using just one 
function,
not manually. Does that answer the question?

Tree<T> {
  T getParent();
  List<T> getChildren();
}

Original comment by zeitlin...@gmail.com on 10 Jun 2009 at 3:07

GoogleCodeExporter commented 9 years ago
-1. I suggest simply writing the couple of lines you need. 

Original comment by jim.andreou on 10 Jun 2009 at 3:37

GoogleCodeExporter commented 9 years ago
We don't approve of overusing Function et al in this way.  At such time as we 
have
the TreeNode interface, you should code directly to that, or roll your own
translation utility.

Original comment by kevin...@gmail.com on 10 Jun 2009 at 3:40

GoogleCodeExporter commented 9 years ago
I didn't know about the TreeNode interface and couldn't find it in the API

Original comment by zeitlin...@gmail.com on 10 Jun 2009 at 6:49

GoogleCodeExporter commented 9 years ago
I said _when_ it exists -- and I'm not saying that time will be soon; but your 
initial 
proposal depends on it as well.

Original comment by kevin...@gmail.com on 10 Jun 2009 at 6:51