| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>TreeTables (Apache SIS 1.3 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="description" content="declaration: package: org.apache.sis.util.collection, class: TreeTables"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.util.collection.TreeTables class"> |
| <meta name="keywords" content="nodeForPath()"> |
| <meta name="keywords" content="replaceCharSequences()"> |
| <meta name="keywords" content="toString()"> |
| <meta name="keywords" content="parse()"> |
| <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"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.0.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="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/TreeTables.html">Use</a></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>Field</li> |
| <li>Constr</li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li>Field</li> |
| <li>Constr</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>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.util.collection</a></div> |
| <h1 title="Class TreeTables" class="title">Class TreeTables</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance"><a href="../Static.html" title="class in org.apache.sis.util">Static</a> |
| <div class="inheritance">TreeTables</div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">TreeTables</span> |
| <span class="extends-implements">extends <a href="../Static.html" title="class in org.apache.sis.util">Static</a></span></div> |
| <div class="block">Static methods working on <a href="TreeTable.html" title="interface in org.apache.sis.util.collection"><code>TreeTable</code></a> objects and their nodes. |
| This class provides methods for some tasks considered generic enough, |
| and example codes for more specialized tasks that developers can customize. |
| |
| <p>The remaining of this class javadoc contains example codes placed in public domain. |
| Developers can copy and adapt those examples as they see fit.</p> |
| |
| <h2>Example 1: Reduce the depth of a tree</h2> |
| For every branch containing exactly one child, the following method concatenates in-place |
| that branch and its child together. This method can be used for simplifying depth trees into |
| something less verbose. For example, given the tree on the left side, this method transforms |
| it into the tree on the right side: |
| |
| <table class="sis"> |
| <caption>Example of tree depth reduction</caption> |
| <tr><th>Before</th><th class="sep">After</th></tr> |
| <tr><td> |
| <blockquote><pre>root |
| ├─users |
| │ └─alice |
| │ ├─data |
| │ │ └─mercator |
| │ └─document |
| └─lib</pre></blockquote> |
| </td><td class="sep"> |
| <blockquote><pre>root |
| ├─users/alice |
| │ ├─data/mercator |
| │ └─document |
| └─lib</pre></blockquote> |
| </td></tr></table> |
| There is no predefined method for this task because there is too many parameters that |
| developers may want to customize (columns to merge, conditions for accepting the merge, |
| kind of objects to merge, name separator, <i>etc.</i>). In the following code snippet, |
| the content of the <code>NAME</code> columns are concatenated only if the <code>VALUE</code> column |
| has no value (for avoiding data lost when the node is discarded) and use the system file |
| separator as name separator: |
| |
| <blockquote><pre><font color="green">final</font> TableColumn columnToProtect = TableColumn.VALUE; |
| <font color="green">final</font> TableColumn columnToConcatenate = TableColumn.NAME; |
| |
| TreeTable.Node <b>concatenateSingletons</b>(<font color="green">final</font> TreeTable.Node node) { |
| <i><font color="gray">// This simple example is restricted to nodes which are known to handle</font></i> |
| <i><font color="gray">// their children in a list instead of some other kind of collection.</font></i> |
| <font color="green">final</font> List<TreeTable.Node> children = (List<TreeTable.Node>) node.<b>getChildren</b>(); |
| <font color="green">final</font> <font color="green">int</font> size = children.<b>size</b>(); |
| <font color="green">for</font> (<font color="green">int</font> i=0; i<size; i++) { |
| children.<b>set</b>(i, <b>concatenateSingletons</b>(children.<b>get</b>(i))); |
| } |
| <font color="green">if</font> (size == 1) { |
| <font color="green">final</font> TreeTable.Node child = children.<b>get</b>(0); |
| <font color="green">if</font> (node.<b>getValue</b>(columnToProtect) == <font color="green">null</font>) { |
| children.<b>remove</b>(0); |
| child.<b>setValue</b>(columnToConcatenate, |
| node .<b>getValue</b>(columnToConcatenate) + File.separator + |
| child.<b>getValue</b>(columnToConcatenate)); |
| <font color="green">return</font> child; |
| } |
| } |
| <font color="green">return</font> node; |
| }</pre></blockquote></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.3</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="TreeTable.html" title="interface in org.apache.sis.util.collection"><code>TreeTable</code></a></li> |
| </ul> |
| </dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- ========== 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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-tab1 method-summary-table-tab4"><code>static <a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#nodeForPath(org.apache.sis.util.collection.TreeTable.Node,org.apache.sis.util.collection.TableColumn,java.io.File)" class="member-name-link">nodeForPath</a><wbr>(<a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a> from, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><? super <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> column, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link">File</a> path)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Finds the node for the given file, or creates a new node if none exists.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#nodeForPath(org.apache.sis.util.collection.TreeTable.Node,org.apache.sis.util.collection.TableColumn,java.nio.file.Path)" class="member-name-link">nodeForPath</a><wbr>(<a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a> from, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><? super <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> column, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link">Path</a> path)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Finds the node for the given path, or creates a new node if none exists.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#parse(java.lang.String,org.apache.sis.util.collection.TableColumn,org.apache.sis.util.collection.TableColumn...)" class="member-name-link">parse</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> tree, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><?> labelColumn, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><?>... otherColumns)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Parses the given string as tree.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static int</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#replaceCharSequences(org.apache.sis.util.collection.TreeTable,java.util.Locale)" class="member-name-link">replaceCharSequences</a><wbr>(<a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a> table, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a> locale)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">For every columns having values of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a>, |
| converts the values to localized <code>String</code>s.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/16/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-tab1 method-summary-table-tab4"><code><a href="#toString(org.apache.sis.util.collection.TreeTable)" class="member-name-link">toString</a><wbr>(<a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a> table)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> |
| <div class="block">Returns a string representation of the given tree table.</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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/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/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/16/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/16/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/16/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"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="nodeForPath(org.apache.sis.util.collection.TreeTable.Node,org.apache.sis.util.collection.TableColumn,java.nio.file.Path)"> |
| <h3>nodeForPath</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a></span> <span class="element-name">nodeForPath</span><wbr><span class="parameters">(<a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a> from, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><? super <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> column, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link">Path</a> path)</span></div> |
| <div class="block">Finds the node for the given path, or creates a new node if none exists. |
| First, this method searches in the node <a href="TreeTable.Node.html#getChildren()">children collection</a> for the root element of the given path. If no such node is found, |
| a <a href="TreeTable.Node.html#newChild()">new child</a> is created. Then this method |
| repeats the process (searching in the children of the child for the second path |
| element), until the last path element is reached. |
| |
| <p>For example if the given path is <code>"users/alice/data"</code>, then this method |
| finds or creates the nodes for the following tree, where <code>"from"</code> is the |
| node given in argument to this method:</p> |
| |
| <blockquote><pre>from |
| └─users |
| └─alice |
| └─data</pre></blockquote></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>from</code> - the root node from which to start the search.</dd> |
| <dd><code>column</code> - the column containing the file name.</dd> |
| <dd><code>path</code> - the path for which to find or create a node.</dd> |
| <dt>Returns:</dt> |
| <dd>the node for the given path, either as an existing node or a new node.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="nodeForPath(org.apache.sis.util.collection.TreeTable.Node,org.apache.sis.util.collection.TableColumn,java.io.File)"> |
| <h3>nodeForPath</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a></span> <span class="element-name">nodeForPath</span><wbr><span class="parameters">(<a href="TreeTable.Node.html" title="interface in org.apache.sis.util.collection">TreeTable.Node</a> from, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><? super <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> column, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/File.html" title="class or interface in java.io" class="external-link">File</a> path)</span></div> |
| <div class="block">Finds the node for the given file, or creates a new node if none exists. |
| This method performs the same work than the above variant, but working on |
| <code>File</code> instances rather than <code>Path</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>from</code> - the root node from which to start the search.</dd> |
| <dd><code>column</code> - the column containing the file name.</dd> |
| <dd><code>path</code> - the file for which to find or create a node.</dd> |
| <dt>Returns:</dt> |
| <dd>the node for the given file, either as an existing node or a new node.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="replaceCharSequences(org.apache.sis.util.collection.TreeTable,java.util.Locale)"> |
| <h3>replaceCharSequences</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">int</span> <span class="element-name">replaceCharSequences</span><wbr><span class="parameters">(<a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a> table, |
| <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a> locale)</span></div> |
| <div class="block">For every columns having values of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link"><code>CharSequence</code></a> or <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a>, |
| converts the values to localized <code>String</code>s. During conversions, this method also |
| replaces duplicated <code>String</code> instances by references to the same singleton instance. |
| |
| <p>This method may be invoked before to serialize the table in order to reduce the |
| serialization stream size.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>table</code> - the table in which to replace values by their string representations.</dd> |
| <dd><code>locale</code> - the locale to use when replacing <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/InternationalString.html" title="class or interface in org.opengis.util" class="external-link"><code>InternationalString</code></a> instances. Can be <code>null</code>.</dd> |
| <dt>Returns:</dt> |
| <dd>number of replacements done.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toString(org.apache.sis.util.collection.TreeTable)"> |
| <h3>toString</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/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><wbr><span class="parameters">(<a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a> table)</span></div> |
| <div class="block">Returns a string representation of the given tree table. |
| The current implementation uses a shared instance of <a href="TreeTableFormat.html" title="class in org.apache.sis.util.collection"><code>TreeTableFormat</code></a>. |
| This is okay for debugging or occasional usages. However for more extensive usages, |
| developers are encouraged to create and configure their own <code>TreeTableFormat</code> |
| instance.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>table</code> - the tree table to format.</dd> |
| <dt>Returns:</dt> |
| <dd>a string representation of the given tree table.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="parse(java.lang.String,org.apache.sis.util.collection.TableColumn,org.apache.sis.util.collection.TableColumn...)"> |
| <h3>parse</h3> |
| <div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="TreeTable.html" title="interface in org.apache.sis.util.collection">TreeTable</a></span> <span class="element-name">parse</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> tree, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><?> labelColumn, |
| <a href="TableColumn.html" title="class in org.apache.sis.util.collection">TableColumn</a><?>... otherColumns)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/text/ParseException.html" title="class or interface in java.text" class="external-link">ParseException</a></span></div> |
| <div class="block">Parses the given string as tree. |
| This helper method is sometimes useful for quick tests or debugging purposes. |
| For more extensive use, consider using <a href="TreeTableFormat.html" title="class in org.apache.sis.util.collection"><code>TreeTableFormat</code></a> instead.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>tree</code> - the string representation of the tree to parse.</dd> |
| <dd><code>labelColumn</code> - the columns where to store the node labels. This is often <a href="TableColumn.html#NAME"><code>TableColumn.NAME</code></a>.</dd> |
| <dd><code>otherColumns</code> - optional columns where to store the values, if any.</dd> |
| <dt>Returns:</dt> |
| <dd>a tree parsed from the given string.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/text/ParseException.html" title="class or interface in java.text" class="external-link">ParseException</a></code> - if an error occurred while parsing the tree.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |