protected AST createAST(int[] values) { AST ast = (AST) F.ast(F.List, values.length, true); for (int i = 0; i < values.length; i++) { ast.set(i + 1, F.integer(values[i])); } return ast; }
/** * Create a new AST matrix instance (i.e. List of Lists) and set all sublist * elements to <code>null</code> * * @param rowSize * the initial number of rows, which should be initialized * @param columnSize * the initial number of columns, which should be assigned to * <code>null</code> * @return a new AST matrix instance */ protected AST createAST(int rowSize, int columnSize) { AST matrix = (AST) F.ast(F.List, rowSize, true); for (int i = 1; i < rowSize + 1; i++) { matrix.set(i, F.ast(F.List, columnSize, false)); } return matrix; }
protected AST createAST(int[][] values) { AST matrix = (AST) F.ast(F.List, values.length, true); IAST row; for (int i = 0; i < values.length; i++) { row = F.ast(F.List, values[i].length, true); matrix.set(i + 1, row); for (int j = 0; j < values[i].length; j++) { row.set(j + 1, F.integer(values[i][j])); } } return matrix; }