Results 1 to 4 of 4
  1. #1
    willemien is offline Member
    Join Date
    Apr 2010
    Location
    london UK
    Posts
    53
    Rep Power
    0

    Default standart tree structure?

    Hi

    Is there a standard tree structure in Java? ( I just want to have to reinvent the wheel)

    I am looking for an utility that can make trees with more than two childeren per node.
    and is able to all kinds of things with it like.

    add leaf,
    remove leaf
    list childeren
    move childeren up/down in the childerens list
    sort childeren
    ed.

    Do i have to write this all myself or is there a standard utility for this?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    Maybe a few ideas from here

    But as far as I know, there is no built in general purpose tree facility (e.g. in java.util and such) that comes with a JRE yet.

    It would be interesting to build one using Java 5+ generics though.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    willemien is offline Member
    Join Date
    Apr 2010
    Location
    london UK
    Posts
    53
    Rep Power
    0

    Default

    No nothing to do with Jtree or another Swing construction.

    it is a datastructure for a game where at every level there are some alternative moves.

    someting like
    Java Code:
    root -- a --b  ---c
                        -- d  (alternative for c)
                 --e          (altenative for  b
                 --f    --g  --h
                         --i
    
    ect
    and where at every node there is some node data
    and so i can append next moves(childeren), and alternative moves.

    So it is really just a datastructure

Similar Threads

  1. Tree structure using JAVA
    By trill in forum Advanced Java
    Replies: 2
    Last Post: 05-27-2010, 11:02 AM
  2. Replies: 0
    Last Post: 04-04-2010, 07:40 AM
  3. how can i do crossover in this tree structure?
    By player123 in forum Advanced Java
    Replies: 2
    Last Post: 02-11-2009, 06:49 PM
  4. Replies: 1
    Last Post: 10-20-2008, 12:58 PM
  5. Printing Tree Structure using Swings
    By pradeep1_mca@yahoo.com in forum AWT / Swing
    Replies: 5
    Last Post: 08-30-2008, 01:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •