public void setExpand(boolean isExpand) { this.isExpand = isExpand; if (!isExpand) { for (Node node : children) { node.setExpand(false); } } }
public int getLevel() { return parent == null ? 0 : parent.getLevel() + 1; }