I have tree, T, structure in an Eclipse plugin which has a different type of parent or node. Now I want to add a tree, T1, to it which has a node of a different type. So what would be the clear and robust approach to do this task as it is assumed that it would get a lots of load so approach should be very visionary?
My approach: As I am very new in this, in my opinion I have to just manage (anyhow) the getParent() method for T1 of same type to T, as this would be the down most sub tree of tree T.
(I want to ask this question for a discussion point of view. I want to just clear my views and approach.)
Make/use a tree interface or abstract class that all the other trees implement/extend, then create a list of that interface or abstract class. E.g:
This interface/abstract class should have all of the methods, getters and setters you will need to access the data you want later on.
If you can’t do that, I think you can only make an array of Object to satisfy this…