public RowGroup newRowGroup() { RowGroup rowGroup = new RowGroup(this); this.rowGroups.add(rowGroup); return rowGroup; }
public String buildTable() { StringBuffer stringBuffer = new StringBuffer(); for (RowGroup rowGroup : this.rowGroups) { stringBuffer.append(rowGroup.buildRowGroup()); } return stringBuffer.toString(); }
public String buildRowGroup(boolean isTabularResult) { this.colSizes = computeColSizes(isTabularResult); StringBuffer stringBuffer = new StringBuffer(); for (Row row : rows) { String builtRow = row.buildRow(isTabularResult); stringBuffer.append(builtRow); if (!builtRow.trim().isEmpty() || row.isBlank) { stringBuffer.append(GfshParser.LINE_SEPARATOR); } } return stringBuffer.toString(); }
Row newRow = rowGroup.newRow(); String prefix = ""; newRowGroup.setColumnSeparator(" | "); newRowGroup.newBlankRow(); newRowGroup.newRow().newLeftCol(fieldNameToDisplay); Row headerRow = newRowGroup.newRow(); columnsMap.put((String) columnName, i); newRowGroup.newRowSeparator('-', false); newRow = newRowGroup.newRow(); for (int i = 0; i < numOfColumns; i++) {
Row newRow = rowGroup.newRow(); String prefix = ""; newRowGroup.setColumnSeparator(" | "); newRowGroup.newBlankRow(); newRowGroup.newRow().newLeftCol(fieldNameToDisplay); Row headerRow = newRowGroup.newRow(); columnsMap.put((String) columnName, i); newRowGroup.newRowSeparator('-', false); newRow = newRowGroup.newRow(); for (int i = 0; i < numOfColumns; i++) {
} else if (key.equals(CompositeResultData.SEPARATOR)) { String separatorString = section.getString(key); rowGroup.newRowSeparator(separatorString.charAt(0), true); } else if (key.equals(ResultData.RESULT_HEADER) || key.equals(ResultData.RESULT_FOOTER)) { Row newRow = rowGroup.newRow(); String prefix = ""; for (int i = 0; i < depth; i++) { newRow.newLeftCol(prefix+key).newLeftCol(value[0]); for (int i = 1; i < value.length; i++) { newRow = rowGroup.newRow(); newRow.setColumnSeparator(" "); newRow.newLeftCol("").newLeftCol(value[i]);
} else if (key.equals(CompositeResultData.SEPARATOR)) { String separatorString = section.getString(key); rowGroup.newRowSeparator(separatorString.charAt(0), true); } else if (key.equals(ResultData.RESULT_HEADER) || key.equals(ResultData.RESULT_FOOTER)) { Row newRow = rowGroup.newRow(); String prefix = ""; for (int i = 0; i < depth; i++) { newRow.newLeftCol(prefix+key).newLeftCol(value[0]); for (int i = 1; i < value.length; i++) { newRow = rowGroup.newRow(); newRow.setColumnSeparator(" "); newRow.newLeftCol("").newLeftCol(value[i]);
stringBuffer.append(this.rowGroup.getColumnSeparator());
stringBuffer.append(this.rowGroup.getColumnSeparator());
GfJsonArray columnNames = content.names(); int numOfColumns = columnNames.size(); Row headerRow = rowGroup.newRow(); rowGroup.setColumnSeparator(" | "); rowGroup.newRowSeparator('-', false);
GfJsonArray columnNames = content.names(); int numOfColumns = columnNames.size(); Row headerRow = rowGroup.newRow(); rowGroup.setColumnSeparator(" | "); rowGroup.newRowSeparator('-', false);
} else if (key.equals(CompositeResultData.SEPARATOR)) { String separatorString = content.getString(key); resultTable.newRowGroup().newRowSeparator(separatorString.charAt(0), true);
} else if (key.equals(CompositeResultData.SEPARATOR)) { String separatorString = content.getString(key); resultTable.newRowGroup().newRowSeparator(separatorString.charAt(0), true);
if (rowGroup.getColumnSeparator() != null) { rowTotalLength += row.getNumCols() * rowGroup.getColumnSeparator().length();
if (rowGroup.getColumnSeparator() != null) { rowTotalLength += row.getNumCols() * rowGroup.getColumnSeparator().length();
/** * @param rowGroup * @param dataRows * @param accumulatedData * @return rows * @throws GfJsonException */ private Row[] buildRows(RowGroup rowGroup, Row[] dataRows, GfJsonArray accumulatedData) throws GfJsonException { int size = accumulatedData.size(); // Initialize rows' array as required if (dataRows == null) { dataRows = new Row[size]; for (int j = 0; j < dataRows.length; j++) { dataRows[j] = rowGroup.newRow(); } } // Add data column-wise for (int j = 0; j < size; j++) { dataRows[j].newLeftCol(accumulatedData.get(j)); } return dataRows; }
/** * @param rowGroup * @param dataRows * @param accumulatedData * @return rows * @throws GfJsonException */ private Row[] buildRows(RowGroup rowGroup, Row[] dataRows, GfJsonArray accumulatedData) throws GfJsonException { int size = accumulatedData.size(); // Initialize rows' array as required if (dataRows == null) { dataRows = new Row[size]; for (int j = 0; j < dataRows.length; j++) { dataRows[j] = rowGroup.newRow(); } } // Add data column-wise for (int j = 0; j < size; j++) { dataRows[j].newLeftCol(accumulatedData.get(j)); } return dataRows; }
public String getColumnSeparator() { return this.columnSeparator != null ? this.columnSeparator : rowGroup.getColumnSeparator(); }
public String getColumnSeparator() { return this.columnSeparator != null ? this.columnSeparator : rowGroup.getColumnSeparator(); }
public void newBlankRow() { RowGroup rowGroup = newRowGroup(); rowGroup.newBlankRow(); }