@Test public void setChild() { TypeConstructorExpr tce = new TypeConstructorExpr("hi", new IntConstantExpr("5")); IntConstantExpr expr = new IntConstantExpr("6"); tce.setChild(0, expr); assertEquals(expr, tce.getArg(0)); }
@Override public void setChild(int index, Expr expr) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } args.set(index, expr); }
TypeConstructorExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } args.set(index, expr); } }
TypeConstructorExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } args.set(index, expr); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); }
TypeConstructorExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } args.set(index, expr); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); String getTypename(); void setTypename(String type); List<Expr> getArgs(); Expr getArg(int index); Expr removeArg(int index); int getNumArgs(); @Override void accept(IAstVisitor visitor); @Override TypeConstructorExpr clone(); void insertArg(int index, Expr arg); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren(); }
TypeConstructorExpr extends Expr { @Override public void setChild(int index, Expr expr) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } args.set(index, expr); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); String getTypename(); void setTypename(String type); List<Expr> getArgs(); Expr getArg(int index); Expr removeArg(int index); int getNumArgs(); @Override void accept(IAstVisitor visitor); @Override TypeConstructorExpr clone(); void insertArg(int index, Expr arg); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }