Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package tree.node;
- public class CategoryTreeNode<NODETYPE, CATEGORY> extends GenericTreeNode<NODETYPE> { //Eldira 11815163
- private CATEGORY category;
- public CategoryTreeNode(CATEGORY category) {
- super(category.toString(), null);
- this.category = category;
- }
- public CATEGORY getCategory() {
- return category;
- }
- public CategoryTreeNode<NODETYPE, CATEGORY> deepCopy()
- {
- CategoryTreeNode<NODETYPE,CATEGORY> clone = new CategoryTreeNode<>((CATEGORY) this.getLabel());
- if(!this.isLeaf())
- {
- for(ITreeNode<NODETYPE> node:this.getChildren())
- {
- clone.getChildren().add(node.deepCopy());
- }
- }
- return clone;
- }
- public String getLabel() {
- return super.getLabel();
- }
- public NODETYPE nodeValue() {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment