| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 --> |
| <title>LineAppender (Apache SIS 1.4 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2023-10-05"> |
| <meta name="description" content="declaration: module: org.apache.sis.util, package: org.apache.sis.io, class: LineAppender"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.io.LineAppender class"> |
| <meta name="keywords" content="getMaximalLineLength()"> |
| <meta name="keywords" content="setMaximalLineLength()"> |
| <meta name="keywords" content="getTabulationWidth()"> |
| <meta name="keywords" content="setTabulationWidth()"> |
| <meta name="keywords" content="isTabulationExpanded()"> |
| <meta name="keywords" content="setTabulationExpanded()"> |
| <meta name="keywords" content="getLineSeparator()"> |
| <meta name="keywords" content="setLineSeparator()"> |
| <meta name="keywords" content="append()"> |
| <meta name="keywords" content="clear()"> |
| <meta name="keywords" content="flush()"> |
| <meta name="keywords" content="onLineBegin()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.1.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../module-summary.html">Module</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li>Nested</li> |
| <li><a href="#field-summary">Field</a></li> |
| <li><a href="#constructor-summary">Constr</a></li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li><a href="#field-detail">Field</a></li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="module-label-in-type">Module</span> <a href="../../../../module-summary.html">org.apache.sis.util</a></div> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.io</a></div> |
| <h1 title="Class LineAppender" class="title">Class LineAppender</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance">LineAppender</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Flushable.html" title="class or interface in java.io" class="external-link">Flushable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">LineAppender</span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| implements <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Flushable.html" title="class or interface in java.io" class="external-link">Flushable</a></span></div> |
| <div class="block">An <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link"><code>Appendable</code></a> which can apply different kinds of reformatting that depend on the |
| <cite>End Of Line</cite> (EOL) occurrences. Available reformatting include inserting a |
| a margin before each line, wrapping to a maximal line length and replacing tabulations or |
| EOL characters. The actual work to be done can be enabled by invoking one or many of the |
| following methods: |
| |
| <ul> |
| <li><a href="#setMaximalLineLength(int)"><code>setMaximalLineLength(int)</code></a> for wrapping the lines to some maximal line length, |
| typically 80 Unicode characters (code points).</li> |
| <li><a href="#setTabulationExpanded(boolean)"><code>setTabulationExpanded(boolean)</code></a> for replacing tabulation characters by spaces.</li> |
| <li><a href="#setLineSeparator(java.lang.String)"><code>setLineSeparator(String)</code></a> for replacing all occurrences of |
| <a href="../util/Characters.html#isLineOrParagraphSeparator(int)">line separators</a> by the given string.</li> |
| </ul> |
| |
| In addition this class removes trailing <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Character.html#isWhitespace(int)" title="class or interface in java.lang" class="external-link">whitespaces</a> |
| before end of lines. |
| |
| <h2 id="how-line-lengths-are-calculated-heading">How line lengths are calculated</h2> |
| Line length are measured in unit of Unicode <cite>code points</cite>. This is usually the same |
| than the number of <code>char</code> primitive values, but not always. Combining characters are not |
| yet recognized by this class, but future versions may improve on that. |
| |
| <p>For proper line length calculation in presence of tabulation characters (<code>'\t'</code>), |
| this class needs to known the tabulation width. The default value is 8, but this can be changed |
| by a call to <a href="#setTabulationWidth(int)"><code>setTabulationWidth(int)</code></a>. Note that invoking that method affects only line |
| length calculation; it does not replace tabulations by spaces. For tabulation expansion, see |
| <a href="#setTabulationExpanded(boolean)"><code>setTabulationExpanded(boolean)</code></a>.</p></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.3</dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected final <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#out" class="member-name-link">out</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">The underlying character output stream or buffer.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.Appendable)" class="member-name-link">LineAppender</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Constructs a default formatter.</div> |
| </div> |
| <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(java.lang.Appendable,int,boolean)" class="member-name-link">LineAppender</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out, |
| int maximalLineLength, |
| boolean isTabulationExpanded)</code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Constructs a formatter which will wrap the lines at a given maximal length.</div> |
| </div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(java.lang.Appendable,java.lang.String,boolean)" class="member-name-link">LineAppender</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> lineSeparator, |
| boolean isTabulationExpanded)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Constructs a formatter which will replaces line separators by the given string.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#append(char)" class="member-name-link">append</a><wbr>(char c)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes a single character.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#append(java.lang.CharSequence)" class="member-name-link">append</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a> sequence)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Appends the specified character sequence.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#append(java.lang.CharSequence,int,int)" class="member-name-link">append</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a> sequence, |
| int start, |
| int end)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Writes a portion of a character sequence.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clear()" class="member-name-link">clear</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Resets the <code>LineAppender</code> internal state as if a new line was beginning.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#flush()" class="member-name-link">flush</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sends all pending characters to the underlying appendable, including trailing whitespaces.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLineSeparator()" class="member-name-link">getLineSeparator</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the line separator to be sent to the underlying appendable, |
| or <code>null</code> if EOL sequences are forwarded unchanged.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMaximalLineLength()" class="member-name-link">getMaximalLineLength</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the maximal line length, in unit of Unicode characters (code point count).</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTabulationWidth()" class="member-name-link">getTabulationWidth</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the current tabulation width, in unit of Unicode characters (code point count).</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isTabulationExpanded()" class="member-name-link">isTabulationExpanded</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if this formatter expands tabulations into spaces.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#onLineBegin(boolean)" class="member-name-link">onLineBegin</a><wbr>(boolean isContinuation)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Invoked when a new line is beginning.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setLineSeparator(java.lang.String)" class="member-name-link">setLineSeparator</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> lineSeparator)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Changes the line separator to be sent to the underlying appendable.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setMaximalLineLength(int)" class="member-name-link">setMaximalLineLength</a><wbr>(int length)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the maximal line length, in units of Unicode characters (code point count).</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTabulationExpanded(boolean)" class="member-name-link">setTabulationExpanded</a><wbr>(boolean expanded)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets whether this class formatter expands tabulations into spaces.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setTabulationWidth(int)" class="member-name-link">setTabulationWidth</a><wbr>(int width)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the tabulation width, in unit of Unicode characters (code point count).</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the content of this <code>Appendable</code> as a string if possible, |
| or the localized <cite>"Unavailable content"</cite> string otherwise.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="out"> |
| <h3>out</h3> |
| <div class="member-signature"><span class="modifiers">protected final</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></span> <span class="element-name">out</span></div> |
| <div class="block">The underlying character output stream or buffer.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(java.lang.Appendable)"> |
| <h3>LineAppender</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">LineAppender</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out)</span></div> |
| <div class="block">Constructs a default formatter. Callers should invoke at least one of the following methods |
| after construction in order to perform useful work: |
| |
| <ul> |
| <li><a href="#setMaximalLineLength(int)"><code>setMaximalLineLength(int)</code></a></li> |
| <li><a href="#setTabulationExpanded(boolean)"><code>setTabulationExpanded(boolean)</code></a></li> |
| <li><a href="#setLineSeparator(java.lang.String)"><code>setLineSeparator(String)</code></a></li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>out</code> - the underlying stream or buffer to write to.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(java.lang.Appendable,java.lang.String,boolean)"> |
| <h3>LineAppender</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">LineAppender</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> lineSeparator, |
| boolean isTabulationExpanded)</span></div> |
| <div class="block">Constructs a formatter which will replaces line separators by the given string.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>out</code> - the underlying stream or buffer to write to.</dd> |
| <dd><code>lineSeparator</code> - the line separator to send to <code>out</code>, or <code>null</code> |
| for forwarding the EOL sequences unchanged.</dd> |
| <dd><code>isTabulationExpanded</code> - <code>true</code> for expanding tabulations into spaces, |
| or <code>false</code> for sending <code>'\t'</code> characters as-is.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(java.lang.Appendable,int,boolean)"> |
| <h3>LineAppender</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">LineAppender</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a> out, |
| int maximalLineLength, |
| boolean isTabulationExpanded)</span></div> |
| <div class="block">Constructs a formatter which will wrap the lines at a given maximal length.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>out</code> - the underlying stream or buffer to write to.</dd> |
| <dd><code>maximalLineLength</code> - the maximal number of Unicode characters per line, |
| or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Integer.MAX_VALUE</code></a> if there is no limit.</dd> |
| <dd><code>isTabulationExpanded</code> - <code>true</code> for expanding tabulations into spaces, |
| or <code>false</code> for forwarding <code>'\t'</code> characters as-is.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getMaximalLineLength()"> |
| <h3>getMaximalLineLength</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getMaximalLineLength</span>()</div> |
| <div class="block">Returns the maximal line length, in unit of Unicode characters (code point count). |
| The default value is no limit.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the current maximal number of Unicode characters per line, |
| or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Integer.MAX_VALUE</code></a> if there is no limit.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setMaximalLineLength(int)"> |
| <h3>setMaximalLineLength</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setMaximalLineLength</span><wbr><span class="parameters">(int length)</span></div> |
| <div class="block">Sets the maximal line length, in units of Unicode characters (code point count).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>length</code> - the new maximal number of Unicode characters per line, |
| or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html#MAX_VALUE" title="class or interface in java.lang" class="external-link"><code>Integer.MAX_VALUE</code></a> if there is no limit.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getTabulationWidth()"> |
| <h3>getTabulationWidth</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getTabulationWidth</span>()</div> |
| <div class="block">Returns the current tabulation width, in unit of Unicode characters (code point count). |
| The default value is 8.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the current tabulation width in number of Unicode characters.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setTabulationWidth(int)"> |
| <h3>setTabulationWidth</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setTabulationWidth</span><wbr><span class="parameters">(int width)</span></div> |
| <div class="block">Sets the tabulation width, in unit of Unicode characters (code point count).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>width</code> - the new tabulation width. Must be greater than 0.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if <code>tabWidth</code> is not greater than 0 |
| or is unreasonably high.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isTabulationExpanded()"> |
| <h3>isTabulationExpanded</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isTabulationExpanded</span>()</div> |
| <div class="block">Returns <code>true</code> if this formatter expands tabulations into spaces. |
| The default value is <code>false</code>, which means that <code>'\t'</code> characters |
| are sent to the underlying appendable <i>as-is</i>.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if this formatter expands tabulations into spaces, |
| or <code>false</code> if <code>'\t'</code> characters are forwarded <i>as-is</i>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setTabulationExpanded(boolean)"> |
| <h3>setTabulationExpanded</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setTabulationExpanded</span><wbr><span class="parameters">(boolean expanded)</span></div> |
| <div class="block">Sets whether this class formatter expands tabulations into spaces.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>expanded</code> - <code>true</code> if this class shall expands tabulations into spaces, |
| or <code>false</code> for forwarding <code>'\t'</code> characters as-is.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getLineSeparator()"> |
| <h3>getLineSeparator</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getLineSeparator</span>()</div> |
| <div class="block">Returns the line separator to be sent to the underlying appendable, |
| or <code>null</code> if EOL sequences are forwarded unchanged.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the current line separator, or <code>null</code> if EOL are forwarded <i>as-is</i>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setLineSeparator(java.lang.String)"> |
| <h3>setLineSeparator</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setLineSeparator</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> lineSeparator)</span></div> |
| <div class="block">Changes the line separator to be sent to the underlying appendable. |
| This is the string to insert in place of every occurrences of <code>"\r"</code>, <code>"\n"</code>, |
| <code>"\r\n"</code> or other <a href="../util/Characters.html#isLineOrParagraphSeparator(int)">line separators</a>. |
| If <code>null</code> (the default), then the line separators given to the <code>append</code> |
| methods are forwarded unchanged.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>lineSeparator</code> - the new line separator, or <code>null</code> for forwarding EOL <i>as-is</i>.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="../util/Characters.html#isLineOrParagraphSeparator(int)"><code>Characters.isLineOrParagraphSeparator(int)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="append(char)"> |
| <h3>append</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></span> <span class="element-name">append</span><wbr><span class="parameters">(char c)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Writes a single character.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html#append(char)" title="class or interface in java.lang" class="external-link">append</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>c</code> - the character to append.</dd> |
| <dt>Returns:</dt> |
| <dd>a reference to this <code>Appendable</code>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an I/O error occurs.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="append(java.lang.CharSequence,int,int)"> |
| <h3>append</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></span> <span class="element-name">append</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a> sequence, |
| int start, |
| int end)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Writes a portion of a character sequence.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html#append(java.lang.CharSequence,int,int)" title="class or interface in java.lang" class="external-link">append</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>sequence</code> - the character sequence to be written.</dd> |
| <dd><code>start</code> - index from which to start reading characters.</dd> |
| <dd><code>end</code> - index of the character following the last character to read.</dd> |
| <dt>Returns:</dt> |
| <dd>a reference to this <code>Appendable</code>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an I/O error occurs.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="clear()"> |
| <h3>clear</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">clear</span>() |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Resets the <code>LineAppender</code> internal state as if a new line was beginning. |
| Trailing whitespaces not yet sent to the <a href="#out">underlying appendable</a> |
| are discarded, and the column position (for tabulation expansion calculation) is |
| reset to 0. This method does not write any line separator.</div> |
| <dl class="notes"> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an error occurred while sending the trailing non-white |
| characters to the underlying stream.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="flush()"> |
| <h3>flush</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">flush</span>() |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Sends all pending characters to the underlying appendable, including trailing whitespaces. |
| Note that this method should preferably be invoked at the end of a word, sentence or line, |
| since invoking this method may prevent <code>LineAppender</code> to properly wrap the current |
| line if the current position is in the middle of a word. |
| |
| <p>Invoking this method also flushes the underlying stream, if <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Flushable.html" title="class or interface in java.io" class="external-link">flushable</a>. |
| A cheaper way to send pending characters is to make sure that the last character is a |
| <a href="../util/Characters.html#isLineOrParagraphSeparator(int)">line or paragraph terminator</a>, |
| or to invoke <a href="#clear()"><code>clear()</code></a>.</p></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Flushable.html#flush()" title="class or interface in java.io" class="external-link">flush</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Flushable.html" title="class or interface in java.io" class="external-link">Flushable</a></code></dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an I/O error occurs.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="onLineBegin(boolean)"> |
| <h3>onLineBegin</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">onLineBegin</span><wbr><span class="parameters">(boolean isContinuation)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Invoked when a new line is beginning. The default implementation does nothing, |
| but subclasses can override this method for example in order to insert a margin |
| on the left side before each line. |
| |
| <p>If an implementation wishes to write characters, it shall do so by writing |
| directly to <a href="#out"><code>out</code></a>, <strong>not</strong> by invoking the <code>append</code> |
| methods of this class.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>isContinuation</code> - <code>true</code> if the new line is the continuation of the previous |
| line after a "line wrap", or <code>false</code> if a line or paragraph separator has |
| been explicitly sent to this formatter.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an error occurred while writing to <a href="#out"><code>out</code></a>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="append(java.lang.CharSequence)"> |
| <h3>append</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></span> <span class="element-name">append</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a> sequence)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Appends the specified character sequence. |
| The default implementation delegates to <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html#append(java.lang.CharSequence,int,int)" title="class or interface in java.lang" class="external-link"><code>Appendable.append(CharSequence, int, int)</code></a>.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html#append(java.lang.CharSequence)" title="class or interface in java.lang" class="external-link">append</a></code> in interface <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Appendable.html" title="class or interface in java.lang" class="external-link">Appendable</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>sequence</code> - the character sequence to append, or <code>null</code>.</dd> |
| <dt>Returns:</dt> |
| <dd>a reference to this <code>Appendable</code>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code> - if an I/O error occurred.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toString()"> |
| <h3>toString</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">toString</span>()</div> |
| <div class="block">Returns the content of this <code>Appendable</code> as a string if possible, |
| or the localized <cite>"Unavailable content"</cite> string otherwise.</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>the content of this <code>Appendable</code>, or a localized message for unavailable content.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list"> |
| <li><a href="IO.html#content(java.lang.Appendable)"><code>IO.content(Appendable)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| </div> |
| </div> |
| </body> |
| </html> |