开发者

Some collection [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. 开发者_如何转开发

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;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜