/** * Returns the width of each column in an array, column one being [0] and so on. * @param rows the table rows with rules and content * @param colNumbers number of columns in the table * @param ctx the original table context, the required width is taken from this context * @return an array with the width for each column */ default int[] calculateColumnWidths(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx){ return this.calculateColumnWidths(rows, colNumbers, ctx.getTextWidth()); } /**
/** * Returns the width of each column in an array, column one being [0] and so on. * @param rows the table rows with rules and content * @param colNumbers number of columns in the table * @param ctx the original table context, the required width is taken from this context * @return an array with the width for each column */ default int[] calculateColumnWidths(LinkedList<AT_Row> rows, int colNumbers, AT_Context ctx){ return this.calculateColumnWidths(rows, colNumbers, ctx.getTextWidth()); } /**
@Override public Collection<String> renderAsCollection(int width){ return ClusterElementTransformer.create().transform( this.renderer.renderAsCollection(this.getRawContent(), this.getColNumber(), this.ctx, this.ctx.getTextWidth(width)), StrBuilder_To_String.create(), ArrayListStrategy.create() ); }
@Override public Collection<String> renderAsCollection(int width){ return ClusterElementTransformer.create().transform( this.renderer.renderAsCollection(this.getRawContent(), this.getColNumber(), this.ctx, this.ctx.getTextWidth(width)), StrBuilder_To_String.create(), ArrayListStrategy.create() ); }
@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; }
int[] colWidth = this.getCWC().calculateColumnWidths(rows, colNumbers, ctx.getTextWidth(width));
int[] colWidth = this.getCWC().calculateColumnWidths(rows, colNumbers, ctx.getTextWidth(width));