- this.head = head;
- this.lift = lift && children != null && children.length > 0;
- this.children = ArrayUtil.clone(children, Tree.class);
+ this.ihead = head;
+
+ int count = 0;
+ for(int i=0; i<children.length; i++)
+ count += lifts[i] ? children[i].size() : 1;
+
+ this.children = new Tree[count];
+ int j = 0;
+ for(int i=0; i<children.length; i++) {
+ if (!lifts[i])
+ this.children[j++] = children[i];
+ else
+ for(int k=0; k<children[i].size(); k++)
+ this.children[j++] = children[i].child(k);
+ }