DefaultTreeModel - populating and concatenation
So, this isn't at ALL a Swing/GUI question, so I apologize up front. However, I know that the people that use these libraries most also do graphical data manipulation, so I figured this would be a good audience.
I have a set of data similar to the following in 2-dimensional array of strings containing the following information (one primary array contains an array for each line; each tuple from each line is stored in a string, e.g. ArrayList<ArrayList<String>>):
What I want to do is take this information and put it in a tree structure. ID is the root hierarchy, Term is second hierarchically, and ClassID is third. Obviously, there is a lot of redundancy - a single student may have been enrolled in multiple terms, and within those terms, a student can take multiple classes. How do I best go from what I have up there to:
ID Term ClassID
100000205 1083 WCOB1023H
100000205 1093 WCOB1033
100033669 1109 MGMT4243
100033669 1109 ACCT3533
100050035 1103 WCOB1023
100050035 1109 WCOB2033
100079394 1079 ISYS2263
100083048 1053 FINN3043
Does that make sense? There's not a whole lot of clear reference or examples regarding non-graphical use of the DefaultTreeModel class (or even JDots). If someone could show me how to a) populate a hierarchy in a tree and perhaps b) how to concatenate tree structures from populated hierarchies, that would be extremely helpful.
Thanks, and I appreciate this forum!