/** * 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 * @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){ Validate.notNull(rows); Validate.notNull(ctx); return this.render(rows, colNumbers, ctx, ctx.getWidth()); }
/** * 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 * @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){ Validate.notNull(rows); Validate.notNull(ctx); return this.render(rows, colNumbers, ctx, ctx.getWidth()); }
/** * 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 * @return collection of lines, each as a {@link StrBuilder} * @throws {@link NullPointerException} if rows or context where null */ default Collection<StrBuilder> renderAsCollection(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx){ Validate.notNull(rows); Validate.notNull(ctx); return this.renderAsCollection(rows, colNumbers, ctx, ctx.getWidth()); }
/** * 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 * @return collection of lines, each as a {@link StrBuilder} * @throws {@link NullPointerException} if rows or context where null */ default Collection<StrBuilder> renderAsCollection(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx){ Validate.notNull(rows); Validate.notNull(ctx); return this.renderAsCollection(rows, colNumbers, ctx, ctx.getWidth()); }
@Override public StrBuilder toLog(){ StrBuilder ret = new StrBuilder(); ret .append("AsciiTable: ") .append("#rows=").append(this.rows.size()) .append(", #columns=").append(this.getColNumber()) .append(", w=").append(this.ctx.getWidth()) .append(", tw=").append(this.ctx.getTextWidth()) .appendNewLine() ; return ret; }
@Override public StrBuilder toLog(){ StrBuilder ret = new StrBuilder(); ret .append("AsciiTable: ") .append("#rows=").append(this.rows.size()) .append(", #columns=").append(this.getColNumber()) .append(", w=").append(this.ctx.getWidth()) .append(", tw=").append(this.ctx.getTextWidth()) .appendNewLine() ; return ret; }