/** Insert child t at child position i (0..n-1) by shifting children i+1..n-1 to the right one position. Set parent / indexes properly but does NOT collapse nil-rooted t's that come in here like addChild. */ public void insertChild(int i, Object t) { if (i < 0 || i > getChildCount()) { throw new IndexOutOfBoundsException(i+" out or range"); } if (children == null) { children = createChildrenList(); } children.add(i, t); // walk others to increment their child indexes // set index, parent of this one too this.freshenParentAndChildIndexes(i); }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = (Tree)getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
private Map<String, String> getTemplateOptions() { Map<String, String> opts = new HashMap<>(); BaseTree t = getChild(1); for (int i = 0; i < t.getChildCount(); i++) { TemplateOptionTree opt = (TemplateOptionTree) t.getChild(i); opt.go(this); opts.put(opt.getKey(), opt.getValue()); } return opts; }
public void freshenParentAndChildIndexes(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { Tree child = getChild(c); child.setChildIndex(c); child.setParent(this); } }
private Map<String, String> getTemplateOptions() { Map<String, String> opts = new HashMap<>(); BaseTree t = getChild(1); for (int i = 0; i < t.getChildCount(); i++) { TemplateOptionTree opt = (TemplateOptionTree) t.getChild(i); opt.go(this); opts.put(opt.getKey(), opt.getValue()); } return opts; }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void sanityCheckParentAndChildIndexes(Tree parent, int i) { if ( parent!=this.getParent() ) { throw new IllegalStateException("parents don't match; expected "+parent+" found "+this.getParent()); } if ( i!=this.getChildIndex() ) { throw new IllegalStateException("child indexes don't match; expected "+i+" found "+this.getChildIndex()); } int n = this.getChildCount(); for (int c = 0; c < n; c++) { CommonTree child = (CommonTree)this.getChild(c); child.sanityCheckParentAndChildIndexes(this, c); } }
public void freshenParentAndChildIndexesDeeply(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { BaseTree child = (BaseTree)getChild(c); child.setChildIndex(c); child.setParent(this); child.freshenParentAndChildIndexesDeeply(); } }
public void freshenParentAndChildIndexesDeeply(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { BaseTree child = (BaseTree)getChild(c); child.setChildIndex(c); child.setParent(this); child.freshenParentAndChildIndexesDeeply(); } }
public void freshenParentAndChildIndexesDeeply(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { BaseTree child = (BaseTree)getChild(c); child.setChildIndex(c); child.setParent(this); child.freshenParentAndChildIndexesDeeply(); } }
public void freshenParentAndChildIndexesDeeply(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { BaseTree child = (BaseTree)getChild(c); child.setChildIndex(c); child.setParent(this); child.freshenParentAndChildIndexesDeeply(); } }
public void freshenParentAndChildIndexesDeeply(int offset) { int n = getChildCount(); for (int c = offset; c < n; c++) { BaseTree child = (BaseTree)getChild(c); child.setChildIndex(c); child.setParent(this); child.freshenParentAndChildIndexesDeeply(); } }