public ComponentTree getClone() { ComponentTree c = new ComponentTree(this.builder.getClone()); c.isExtendedTree = this.isExtendedTree; c.sup = this.sup; c.inf = this.inf; for (NodeCT node : c.getListNodes()) { node.attributes = (HashMap<Integer, Attribute>) this.getSC(node.getCanonicalPixel()).attributes.clone(); } if (this.isExtendedTree) { c.extendedTree(); } return c; }
public void prunning(NodeCT node) { if (node != root && map[node.getCanonicalPixel()] == node) { NodeCT parent = node.parent; parent.children.remove(node); listLeaves = null; for (NodeCT no : node.getNodesDescendants()) { listNode.remove(no); numNode--; for (int p : no.getCanonicalPixels()) { parent.addPixel(p); map[p] = parent; } } } }