/** * Renders an {@link AsciiTable}. * @param rows table rows to render, cannot be null * @param colNumbers number of columns in the table * @param ctx context of the original table with relevant settings, cannot be null * @param width maximum line width, excluding any extra padding * @return a single string with the rendered table * @throws {@link NullPointerException} if rows or context where null */ default String render(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx, int width){ Validate.notNull(rows); Validate.notNull(ctx); Collection<StrBuilder> coll = this.renderAsCollection(rows, colNumbers, ctx, width); String fileSeparator = this.getLineSeparator(); if(fileSeparator==null){ fileSeparator = ctx.getLineSeparator(); } if(fileSeparator==null){ fileSeparator = System.lineSeparator(); } return new StrBuilder().appendWithSeparators(coll, fileSeparator).build(); }
/** * Renders an {@link AsciiTable}. * @param rows table rows to render, cannot be null * @param colNumbers number of columns in the table * @param ctx context of the original table with relevant settings, cannot be null * @param width maximum line width, excluding any extra padding * @return a single string with the rendered table * @throws {@link NullPointerException} if rows or context where null */ default String render(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx, int width){ Validate.notNull(rows); Validate.notNull(ctx); Collection<StrBuilder> coll = this.renderAsCollection(rows, colNumbers, ctx, width); String fileSeparator = this.getLineSeparator(); if(fileSeparator==null){ fileSeparator = ctx.getLineSeparator(); } if(fileSeparator==null){ fileSeparator = System.lineSeparator(); } return new StrBuilder().appendWithSeparators(coll, fileSeparator).build(); }