Some collection [closed]
I'm needing to store a link structure. As a hierarchy, for example, x link, links children of x, y link, links children of y. Resorting to the use of java object id. I wonder if you have something like this in Java, any collection that does it for me.
Thanks!
AFAIK, there's no standard java Collections class for this.
However, it's not a tough class to write. Something like this would do:
class Node {
List<Node> children = new ArrayList();
public List<Node> getChildren() {
return children;
}
}
精彩评论