For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {TableAppender t =
String str;new TableAppender(str)
Appendable out;String str;new TableAppender(out, str)
Appendable out;new TableAppender(out)
- Smart code suggestions by Codota
}
/** * Creates a new test case. */ public TableAppenderTest() { appender = table = new TableAppender(appender); }
/** * Formats the specified hints. This method is just the starting * point for {@link #format(Writer, Map, String, Map)} below. */ private static String format(final Map<?,?> hints, final Map<Factory,String> done) { final TableAppender table; try { table = new TableAppender(" "); format(table, hints, " ", done); } catch (IOException e) { // Should never happen, since we are writing in a buffer. throw new AssertionError(e); } return table.toString(); }
/** * Returns a string representation of the keys and associated values in this {@code CRSBuilder}. */ @Override public final String toString() { final StringBuilder buffer = new StringBuilder("GeoTIFF keys ").append(majorRevision).append('.') .append(minorRevision).append(" in ").append(reader.input.filename).append(System.lineSeparator()); final TableAppender table = new TableAppender(buffer, " "); for (Map.Entry<Short,Object> entry : geoKeys.entrySet()) { final short key = entry.getKey(); table.append(String.valueOf(key)).nextColumn(); table.append(GeoKeys.name(key)).nextColumn(); table.append(" = ").append(String.valueOf(entry.getValue())).nextLine(); } try { table.flush(); } catch (IOException e) { throw new UncheckedIOException(e); // Should never happen since we wrote to a StringBuffer. } return buffer.toString(); } }
/** * Creates a new instance which will write to the given appendable. * * @param out where to format the tree. * @param columns the columns of the tree table to format. * @param recursivityGuard an initially empty set. */ Writer(final Appendable out, final TableColumn<?>[] columns, final Set<TreeTable.Node> recursivityGuard) { super(columns.length >= 2 ? new TableAppender(out, "") : out); this.columns = columns; this.formats = getFormats(columns, false); this.values = new Object[columns.length]; this.isLast = new boolean[8]; this.recursivityGuard = recursivityGuard; setTabulationExpanded(true); setLineSeparator(" ¶ "); }
writer = buffer = new StringWriter(); out = new TableAppender(new LineWriter(writer, lineSeparator), " ");
final TableAppender writer = new TableAppender(out, " "); for (final Map.Entry<String,String> entry : failures.entrySet()) { writer.append(entry.getKey());
/** * Returns a string representation of this metadata object. * * @return a string representation of this metadata. */ @Override public String toString() { final StringBuilder buffer = new StringBuilder(); buffer.append("GPX metadata").append(System.lineSeparator()); final TableAppender table = new TableAppender(buffer); table.setMultiLinesCells(true); table.appendHorizontalSeparator(); append(table, "Creator", creator); append(table, "Name", name); append(table, "Description", description); append(table, "Author", author); append(table, "Copyright", copyright); append(table, "Link(s)", links, System.lineSeparator()); append(table, "Time", (time != null) ? time.toInstant() : null); append(table, "Keywords", keywords, " "); append(table, "Bounds", bounds); table.appendHorizontalSeparator(); try { table.flush(); } catch (IOException e) { throw new UncheckedIOException(e); // Should never happen since we are writing to a StringBuilder. } return buffer.toString(); }
/** * Returns a string representation of this builder for debugging purpose. * * @return a string representation of this builder. */ @Override public String toString() { final StringBuilder buffer = new StringBuilder(Classes.getShortClassName(this)).append('['); if (sources != null) { buffer.append(sources[0].length).append(" points"); } buffer.append(']'); if (transform != null) { final String lineSeparator = System.lineSeparator(); buffer.append(':').append(lineSeparator); final TableAppender table = new TableAppender(buffer, " "); table.setMultiLinesCells(true); table.append(Matrices.toString(transform.getMatrix())).nextColumn(); table.append(lineSeparator).append(" ") .append(Vocabulary.format(Vocabulary.Keys.Correlation)).append(" =").nextColumn(); table.append(Matrices.create(correlation.length, 1, correlation).toString()); try { table.flush(); } catch (IOException e) { throw new UncheckedIOException(e); // Should never happen since we wrote into a StringBuilder. } } return buffer.toString(); } }
/** * Creates a new instance which will write to the given appendable. * * @param out where to format the tree. * @param tree the tree table to format. * @param columns the columns of the tree table to format. * @param recursivityGuard an initially empty set. */ Writer(final Appendable out, final TreeTable tree, final TableColumn<?>[] columns, final Set<TreeTable.Node> recursivityGuard) { super(columns.length >= 2 ? new TableAppender(out, "") : out); multiLineCells = (super.out == out); this.columns = columns; this.formats = getFormats(columns, false); this.values = new Object[columns.length]; this.isLast = new boolean[8]; this.recursivityGuard = recursivityGuard; Predicate<TreeTable.Node> filter = nodeFilter; if (tree instanceof TreeFormatCustomization) { final Predicate<TreeTable.Node> more = ((TreeFormatCustomization) tree).filter(); if (more != null) { filter = (filter != null) ? more.and(filter) : more; } } this.filter = filter; setTabulationExpanded(true); setLineSeparator(multiLineCells ? TreeTableFormat.this.getLineSeparator() : " ¶ "); }
final String lineSeparator = System.lineSeparator(); buffer.append(':').append(lineSeparator); final TableAppender table = new TableAppender(buffer, " "); table.setMultiLinesCells(true); table.append(Matrices.toString(transform.getMatrix())).nextColumn();
/** * Creates an initially empty (except for the header) table of mismatches. * * @param table The table name. * @param pkColumns The column names. * @return A new table of mismatch. * @throws IOException if an error occurred while writing to the output stream. */ private TableAppender createMismatchTable(final String table, final String[] pkColumns) throws IOException { final String lineSeparator = System.lineSeparator(); out.write(lineSeparator); out.write(table); out.write(lineSeparator); final TableAppender mismatchs = new TableAppender(out); mismatchs.nextLine('\u2500'); for (int j=0; j<pkColumns.length; j++) { mismatchs.append(pkColumns[j]); mismatchs.nextColumn(); } mismatchs.append("Colonne"); mismatchs.nextColumn(); mismatchs.append("Valeur à copier"); mismatchs.nextColumn(); mismatchs.append("Valeur existante"); mismatchs.nextLine(); mismatchs.nextLine('\u2500'); return mismatchs; }
/** * Returns a string representation of this region for debugging purpose. * * @return a string representation of this region. */ @Override public String toString() { final TableAppender table = new TableAppender(" "); table.setCellAlignment(TableAppender.ALIGN_RIGHT); table.append("size").nextColumn(); table.append("skip").nextLine(); for (int i=0; i<targetSize.length; i++) { table.append(String.valueOf(targetSize[i])).nextColumn(); table.append(String.valueOf(skips[i])).nextLine(); } return table.toString(); } }
/** * Returns a string representation of this map. The default implementation is different than the * {@code java.util.AbstractMap} one, as it uses a tabular format rather than formatting all entries * on a single line. * * @return a string representation of this map. */ @Override public String toString() { final TableAppender buffer = new TableAppender(" = "); buffer.setMultiLinesCells(true); final EntryIterator<K,V> it = entryIterator(); if (it != null) while (it.next()) { buffer.append(String.valueOf(it.getKey())); buffer.nextColumn(); buffer.append(AbstractMapEntry.firstLine(it.getValue())); buffer.nextLine(); } return buffer.toString(); } }
/** * Tests the {@link TableAppender#toString()} method. * The intent of this test is also to ensure that we can use the API * more easily, without having to deal with {@link IOException}. */ @Test public void testToString() { // NO throws IOException /* * First, ensure that TableAppender.toString() does not * mess with the content of user-supplied Appendable. */ testToString(table, ""); /* * When TableAppender is created with its own internal buffer, * then TableAppender.toString() is allowed to format the table. */ testToString(new TableAppender(), "╔═════════╤═════════╤════════╗\n" + "║ English │ French │ r.e.d. ║\n" + "╟─────────┼─────────┼────────╢\n" + "║ Mercury │ Mercure │ 0.382 ║\n" + "║ Venus │ Vénus │ 0.949 ║\n" + "║ Earth │ Terre │ 1.00 ║\n" + "╚═════════╧═════════╧════════╝\n"); }
/** * Returns a string representation of this map. The default implementation is different than the * {@code java.util.AbstractMap} one, as it uses a tabular format rather than formatting all entries * on a single line. * * @return a string representation of this map. */ @Override public String toString() { final TableAppender buffer = new TableAppender(" = "); buffer.setMultiLinesCells(true); final EntryIterator<K,V> it = entryIterator(); if (it != null) while (it.next()) { buffer.append(String.valueOf(it.getKey())); buffer.nextColumn(); buffer.append(AbstractMapEntry.firstLine(it.getValue())); buffer.nextLine(); } return buffer.toString(); } }
.append("The following tests have logged messages at level INFO or higher:").append(lineSeparator) .append("See 'org.apache.sis.test.LoggingWatcher' for information about logging during tests.").append(lineSeparator); final TableAppender table = new TableAppender(out); table.setMultiLinesCells(false); table.nextLine('═');
public String getBackingStoreDescription() throws FactoryException { final Citation authority = getAuthority(); final TableAppender table = new TableAppender(" "); final Vocabulary resources = Vocabulary.getResources(null); CharSequence cs;
/** * Writes a string representation of this grid envelope in the given buffer. * This method is provided for allowing caller to recycle the same buffer. * * @param out where to write the string representation. * @param vocabulary resources for some words. */ final void appendTo(final StringBuilder out, final Vocabulary vocabulary) { final TableAppender table = new TableAppender(out, ""); final int dimension = getDimension(); for (int i=0; i<dimension; i++) { CharSequence name; if ((types == null) || (name = Types.getCodeTitle(types[i])) == null) { name = vocabulary.getString(Vocabulary.Keys.Dimension_1, i); } final long lower = coordinates[i]; final long upper = coordinates[i + dimension]; table.setCellAlignment(TableAppender.ALIGN_LEFT); table.append(name).append(": ").nextColumn(); table.append('[').nextColumn(); table.setCellAlignment(TableAppender.ALIGN_RIGHT); table.append(Long.toString(lower)).append(" … ").nextColumn(); table.append(Long.toString(upper)).append("] ") .nextColumn(); table.append('(').append(vocabulary.getString(Vocabulary.Keys.CellCount_1, Long.toUnsignedString(upper - lower + 1))).append(')').nextLine(); } flush(table); }
protected final void printInternalWKT() { @SuppressWarnings("UseOfSystemOutOrSystemErr") final TableAppender table = new TableAppender(System.out); table.setMultiLinesCells(true); table.appendHorizontalSeparator();
final TableAppender table = new TableAppender(out); table.appendHorizontalSeparator(); table.append("Eccentricity"); table.nextColumn();