craigday
29 Jun 2008, 7:42 PM
BaseTreeModel is declared as:
public class BaseTreeModel<T extends TreeModel> extends BaseModel implements TreeModel<T> { .. }
with the parent attribute of type T:
protected T parent;
and the children collection of type List<T>:
protected List<T> children;
This is extremely restrictive i.e. mandating that the parent and children be of the same type. I can honestly say that I have never actually designed or worked with tree models where all the data nodes were of the same type.
Can you split the parent and child type parameters into separate types?
Cheers
Craig
public class BaseTreeModel<T extends TreeModel> extends BaseModel implements TreeModel<T> { .. }
with the parent attribute of type T:
protected T parent;
and the children collection of type List<T>:
protected List<T> children;
This is extremely restrictive i.e. mandating that the parent and children be of the same type. I can honestly say that I have never actually designed or worked with tree models where all the data nodes were of the same type.
Can you split the parent and child type parameters into separate types?
Cheers
Craig