Tabnine Logo
LineAppender.setTabulationWidth
Code IndexAdd Tabnine to your IDE (free)

How to use
setTabulationWidth
method
in
org.apache.sis.io.LineAppender

Best Java code snippets using org.apache.sis.io.LineAppender.setTabulationWidth (Showing top 5 results out of 315)

origin: Geomatys/geotoolkit

/**
 * Sets the tab width.
 *
 * @param  tabWidth The tab width. Must be greater than 0.
 * @throws IllegalArgumentException if {@code tabWidth} is not greater than 0.
 */
public void setTabWidth(final int tabWidth) throws IllegalArgumentException {
  synchronized (lock) {
    formatter.setTabulationWidth(tabWidth);
  }
}
origin: Geomatys/geotoolkit

/**
 * Returns the exception trace as a string. This method get the stack trace using the
 * {@link Throwable#printStackTrace(PrintWriter)} method, then replaces the tabulation
 * characters by 4 white spaces.
 *
 * @param exception The exception to format.
 * @return A string representation of the given exception.
 */
public static String formatStackTrace(final Throwable exception) {
  final StringWriter writer = new StringWriter();
  exception.printStackTrace(new PrintWriter(writer));
  final StringBuilder buffer = new StringBuilder();
  final LineAppender formatter = new LineAppender(buffer);
  formatter.setTabulationWidth(TAB_WIDTH);
  try {
    formatter.append(writer.toString());
  } catch (IOException e) {
    throw new AssertionError(e);
  }
  return buffer.toString();
}
origin: apache/sis

buffer  = str.getBuffer().append(header);
printer = new PrintWriter(IO.asWriter(writer));
writer.setTabulationWidth(4);
origin: org.apache.sis.core/sis-utility

buffer  = str.getBuffer().append(header);
printer = new PrintWriter(IO.asWriter(writer));
writer.setTabulationWidth(4);
origin: apache/sis

  /**
   * Tests a call to {@link LineAppender#flush()} interleaved between two lines,
   * where the second line begin with a tabulation.
   *
   * @throws IOException should never happen, since we are writing in a {@link StringBuilder}.
   *
   * @see <a href="https://issues.apache.org/jira/browse/SIS-140">SIS-140</a>
   */
  @Test
  public void testInterleavedFlush() throws IOException {
    final LineAppender f = (LineAppender) appender;
    f.setTabulationWidth(4);
    f.append("S1");
    f.flush();
    f.append("\tS2");
    assertOutputEquals(f.isTabulationExpanded() ? "S1  S2" : "S1\tS2");
  }
}
org.apache.sis.ioLineAppendersetTabulationWidth

Javadoc

Sets the tabulation width, in unit of Unicode characters (code point count).

Popular methods of LineAppender

  • <init>
    Constructs a formatter which will replaces line separators by the given string.
  • append
    Writes a portion of a character sequence.
  • getLineSeparator
    Returns the line separator to be sent to the underlying appendable, or null if EOL sequences are for
  • flush
    Sends all pending characters to the underlying appendable, including trailing whitespaces. Note that
  • getTabulationWidth
    Returns the current tabulation width, in unit of Unicode characters (code point count). The default
  • setLineSeparator
    Changes the line separator to be sent to the underlying appendable. This is the string to insert in
  • appendCodePoint
  • appendSurrogate
  • deleteSoftHyphen
    Removes the soft hyphen characters from the given buffer. This is invoked when the buffer is about t
  • endOfLine
    Writes pending non-white characters, discards trailing whitespaces, and resets column position to ze
  • getMaximalLineLength
    Returns the maximal line length, in unit of Unicode characters (code point count). The default value
  • isTabulationExpanded
    Returns true if this formatter expands tabulations into spaces. The default value is false, which me
  • getMaximalLineLength,
  • isTabulationExpanded,
  • lineSeparator,
  • onLineBegin,
  • setTabulationExpanded,
  • toCodePoint,
  • transfer,
  • write,
  • writeLineSeparator

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now