TableAppender.<init>
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.apache.sis.io.TableAppender.<init> (Showing top 20 results out of 315)

  • Common ways to obtain TableAppender
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
}
origin: apache/sis

/**
 * Creates a new test case.
 */
public TableAppenderTest() {
  appender = table = new TableAppender(appender);
}
origin: Geomatys/geotoolkit

/**
 * 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();
}
origin: apache/sis

  /**
   * 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();
  }
}
origin: org.apache.sis.core/sis-utility

/**
 * 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(" ¶ ");
}
origin: Geomatys/geotoolkit

  writer = buffer = new StringWriter();
out = new TableAppender(new LineWriter(writer, lineSeparator), " ");
origin: Geomatys/geotoolkit

final TableAppender writer = new TableAppender(out, " ");
for (final Map.Entry<String,String> entry : failures.entrySet()) {
  writer.append(entry.getKey());
origin: apache/sis

/**
 * 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();
}
origin: apache/sis

  /**
   * 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();
  }
}
origin: apache/sis

/**
 * 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() : " ¶ ");
}
origin: org.apache.sis.core/sis-referencing

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();
origin: Geomatys/geotoolkit

/**
 * 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;
}
origin: apache/sis

  /**
   * 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();
  }
}
origin: org.apache.sis.core/sis-utility

  /**
   * 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();
  }
}
origin: apache/sis

/**
 * 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");
}
origin: apache/sis

  /**
   * 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();
  }
}
origin: apache/sis

  .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('═');
origin: Geomatys/geotoolkit

public String getBackingStoreDescription() throws FactoryException {
  final Citation   authority = getAuthority();
  final TableAppender    table = new TableAppender(" ");
  final Vocabulary resources = Vocabulary.getResources(null);
  CharSequence cs;
origin: apache/sis

/**
 * 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);
}
origin: apache/sis

protected final void printInternalWKT() {
  @SuppressWarnings("UseOfSystemOutOrSystemErr")
  final TableAppender table = new TableAppender(System.out);
  table.setMultiLinesCells(true);
  table.appendHorizontalSeparator();
origin: apache/sis

final TableAppender table = new TableAppender(out);
table.appendHorizontalSeparator();
table.append("Eccentricity");            table.nextColumn();
org.apache.sis.ioTableAppender<init>

Javadoc

Creates a new table formatter writing in an internal buffer with a default column separator. The default is a vertical double line for the left and right table borders, and a single line between the columns.

Popular methods of TableAppender

  • append
    Writes a portion of a character sequence. Tabulations and line separators are interpreted as by #app
  • nextColumn
    Moves one column to the right, filling remaining space with the given character. The subsequent writ
  • nextLine
    Moves to the first column on the next row, filling every remaining cell in the current row with the
  • flush
    Flushes the table content to the underlying stream or buffer. This method should not be called befor
  • setMultiLinesCells
    Sets the desired behavior for EOL and tabulations characters. * If true, then tabulations, org.ap
  • appendHorizontalSeparator
    Writes an horizontal separator using the '─' character.
  • setCellAlignment
    Sets the alignment of the text inside the current cell. The alignments of any cell written prior thi
  • toString
    Returns the content of this TableAppender as a string if possible. * If this TableAppender has be
  • appendCodePoint
  • appendSurrogate
  • getLineSeparator
    Returns the line separator between table rows. This is the first line separator found in the text fo
  • isEmpty
    Checks if array contains only null elements.
  • getLineSeparator,
  • isEmpty,
  • isHighSurrogate,
  • lineSeparator,
  • repeat,
  • toCodePoint,
  • writeBorder,
  • writeTable

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • JList (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Table (org.hibernate.mapping)
    A relational table
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)