blob: c0992b87a9d31820c487af016acc2b0762e7be45 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>Containers (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.util.collection, class: Containers">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.util.collection.Containers class">
<meta name="keywords" content="isNullOrEmpty()">
<meta name="keywords" content="unmodifiableList()">
<meta name="keywords" content="derivedSet()">
<meta name="keywords" content="derivedMap()">
<meta name="keywords" content="property()">
<meta name="keywords" content="hashMapCapacity()">
<meta name="keywords" content="compare()">
<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">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</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>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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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>&nbsp;<a href="../../../../../module-summary.html">org.apache.sis.util</a></div>
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.util.collection</a></div>
<h1 title="Class Containers" class="title">Class Containers</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"><a href="../Static.html" title="class in org.apache.sis.util">Static</a>
<div class="inheritance">Containers</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">Containers</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="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link"><code>Collection</code></a> or <a href="CheckedContainer.html" title="interface in org.apache.sis.util.collection"><code>Checked­Container</code></a> objects.
Unless otherwise noted in the javadoc, every collections returned by the methods
in this class implement the <code>Checked­Container</code> interface.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.3</dd>
</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 &lt;E extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;E&gt;&gt;<br>int</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#compare(java.util.Iterator,java.util.Iterator)" class="member-name-link">compare</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;E&gt;&nbsp;it1,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;? extends E&gt;&nbsp;it2)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Compares element-by-element the values provided by two iterators, in iteration order.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;SK,<wbr>
SV,<wbr>
K,<wbr>
V&gt;<br><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><wbr>&lt;K,<wbr>V&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)" class="member-name-link">derived­Map</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;SK,<wbr>SV&gt;&nbsp;storage,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">Object­Converter</a>&lt;SK,<wbr>K&gt;&nbsp;key­Converter,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">Object­Converter</a>&lt;SV,<wbr>V&gt;&nbsp;value­Converter)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;S,<wbr>
E&gt;&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a><wbr>&lt;E&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)" class="member-name-link">derived­Set</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>&lt;S&gt;&nbsp;storage,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">Object­Converter</a>&lt;S,<wbr>E&gt;&nbsp;converter)</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 set whose elements are derived <cite>on-the-fly</cite> from the given set.</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="#hashMapCapacity(int)" class="member-name-link">hash­Map­Capacity</a><wbr>(int&nbsp;count)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the capacity to be given to the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#%3Cinit%3E(int)" title="class or interface in java.util" class="external-link"><code>Hash­Map</code></a>
constructor for holding the given number of elements.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isNullOrEmpty(java.util.Collection)" class="member-name-link">is­Null­Or­Empty</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;?&gt;&nbsp;collection)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given collection is either null or
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#isNullOrEmpty(java.util.Map)" class="member-name-link">is­Null­Or­Empty</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;?,<wbr>?&gt;&nbsp;map)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if the given map is either null or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;T&gt;&nbsp;T</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#property(java.util.Map,java.lang.Object,java.lang.Class)" class="member-name-link">property</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;?,<wbr>?&gt;&nbsp;properties,
<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>&nbsp;key,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;type)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the value mapped to the given key casted to the given type,
or <code>null</code> if the map is null or does not contain a value for the key.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;E&gt;&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr>&lt;? extends E&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#unmodifiableList(E...)" class="member-name-link">unmodifiable­List</a><wbr>(E...&nbsp;array)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an unmodifiable view of the given array.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static &lt;E&gt;&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr>&lt;? extends E&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#unmodifiableList(E%5B%5D,int,int)" class="member-name-link">unmodifiable­List</a><wbr>(E[]&nbsp;array,
int&nbsp;lower,
int&nbsp;upper)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns an unmodifiable view of a subregion of the given array.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<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">get­Class</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">hash­Code</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">notify­All</a>, <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">to­String</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">
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="isNullOrEmpty(java.util.Collection)">
<h3>isNullOrEmpty</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isNullOrEmpty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;?&gt;&nbsp;collection)</span></div>
<div class="block">Returns <code>true</code> if the given collection is either null or
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>. If this method returns <code>false</code>,
then the given collection is guaranteed to be non-null and to contain at least
one element.
<p>This is a convenience method for classes implementing the <cite>lazy instantiation</cite>
pattern. In such cases, null collections (i.e. collections not yet instantiated) are typically
considered as <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>collection</code> - the collection to test, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given collection is null or empty, or <code>false</code> otherwise.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="isNullOrEmpty(java.util.Map)">
<h3>isNullOrEmpty</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isNullOrEmpty</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;?,<wbr>?&gt;&nbsp;map)</span></div>
<div class="block">Returns <code>true</code> if the given map is either null or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>.
If this method returns <code>false</code>, then the given map is guaranteed to be non-null and
to contain at least one element.
<p>This is a convenience method for classes implementing the <cite>lazy instantiation</cite>
pattern. In such cases, null maps (i.e. maps not yet instantiated) are typically considered
as <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#isEmpty()" title="class or interface in java.util" class="external-link">empty</a>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>map</code> - the map to test, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given map is null or empty, or <code>false</code> otherwise.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unmodifiableList(E...)">
<h3 id="unmodifiableList(java.lang.Object[])">unmodifiableList</h3>
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SafeVarargs.html" title="class or interface in java.lang" class="external-link">@SafeVarargs</a>
</span><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;E&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends E&gt;</span>&nbsp;<span class="element-name">unmodifiableList</span><wbr><span class="parameters">(E...&nbsp;array)</span></div>
<div class="block">Returns an unmodifiable view of the given array. A direct reference to the given array is
retained (i.e. the array is <strong>not</strong> cloned). Consequently, the given array
shall not be modified after construction if the returned list is intended to be immutable.
<p>The returned list implements the <a href="CheckedContainer.html" title="interface in org.apache.sis.util.collection"><code>Checked­Container</code></a> interface. The value returned by
its <a href="CheckedContainer.html#getElementType()"><code>Checked­Container​.get­Element­Type()</code></a> method is inferred from the array component type.
Because arrays in the Java language are covariant (at the contrary of collections),
the list type have to be <code>&lt;? extends E&gt;</code> instead of <code>&lt;E&gt;</code>.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>E</code> - the base type of elements in the list.</dd>
<dt>Parameters:</dt>
<dd><code>array</code> - the array to wrap, or <code>null</code> if none.</dd>
<dt>Returns:</dt>
<dd>the given array wrapped in an unmodifiable list, or <code>null</code> if the given array was null.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Arrays.html#asList(T...)" title="class or interface in java.util" class="external-link"><code>Arrays​.as­List(Object[])</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="unmodifiableList(E[],int,int)">
<h3 id="unmodifiableList(java.lang.Object[],int,int)">unmodifiableList</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;E&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends E&gt;</span>&nbsp;<span class="element-name">unmodifiableList</span><wbr><span class="parameters">(E[]&nbsp;array,
int&nbsp;lower,
int&nbsp;upper)</span></div>
<div class="block">Returns an unmodifiable view of a subregion of the given array. A direct reference to the
given array is retained (i.e. the array is <strong>not</strong> cloned). Consequently, the
specified sub-region of the given array shall not be modified after construction if the
returned list is intended to be immutable.
<p>The returned list implements the <a href="CheckedContainer.html" title="interface in org.apache.sis.util.collection"><code>Checked­Container</code></a> interface. The value returned by
its <a href="CheckedContainer.html#getElementType()"><code>Checked­Container​.get­Element­Type()</code></a> method is inferred from the array component type.
Because arrays in the Java language are covariant (at the contrary of collections),
the list type have to be <code>&lt;? extends E&gt;</code> instead of <code>&lt;E&gt;</code>.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>E</code> - the type of elements in the list.</dd>
<dt>Parameters:</dt>
<dd><code>array</code> - the array to wrap (cannot be null).</dd>
<dd><code>lower</code> - low endpoint (inclusive) of the sublist.</dd>
<dd><code>upper</code> - high endpoint (exclusive) of the sublist.</dd>
<dt>Returns:</dt>
<dd>the given array wrapped in an unmodifiable list.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the lower or upper value are out of bounds.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)">
<h3>derivedSet</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;S,<wbr>
E&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>&lt;E&gt;</span>&nbsp;<span class="element-name">derivedSet</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html" title="class or interface in java.util" class="external-link">Set</a>&lt;S&gt;&nbsp;storage,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a>&lt;S,<wbr>E&gt;&nbsp;converter)</span></div>
<div class="block">Returns a set whose elements are derived <cite>on-the-fly</cite> from the given set.
Conversions from the original elements to the derived elements are performed when needed
by invoking the <a href="../ObjectConverter.html#apply(S)"><code>Object­Converter​.apply(Object)</code></a> method on the given converter.
Those conversions are repeated every time a <code>Set</code> method is invoked; there is no cache.
Consequently, any change in the original set is immediately visible in the derived set,
and conversely.
<p>The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html#add(E)" title="class or interface in java.util" class="external-link"><code>Set​.add(E)</code></a> method is supported only if the given converter
is <a href="../../math/FunctionProperty.html#INVERTIBLE">invertible</a>.
An invertible converter is not mandatory for other <code>Set</code> operations.
However, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html#contains(java.lang.Object)" title="class or interface in java.util" class="external-link"><code>contains</code></a> and <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html#remove(java.lang.Object)" title="class or interface in java.util" class="external-link"><code>remove</code></a>
operations are likely to be faster if the inverse converter is available.</p>
<p>The derived set may contain fewer elements than the original set if some elements
are not convertible. Non-convertible elements are <var>S</var> values for which
<code>converter​.apply(S)</code> returns <code>null</code>. As a consequence of this sentinel
value usage, the derived set cannot contain <code>null</code> elements.</p>
<p>The returned set can be serialized if the given set and converter are serializable.
The returned set is not synchronized by itself, but is nevertheless thread-safe if the
given set (including its iterator) and converter are thread-safe.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>S</code> - the type of elements in the storage (original) set.</dd>
<dd><code>E</code> - the type of elements in the derived set.</dd>
<dt>Parameters:</dt>
<dd><code>storage</code> - the storage set containing the original elements, or <code>null</code>.</dd>
<dd><code>converter</code> - the converter from the elements in the storage set to the elements in the derived set.</dd>
<dt>Returns:</dt>
<dd>a view over the <code>storage</code> set containing all elements converted by the given converter,
or <code>null</code> if <code>storage</code> was null.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../ObjectConverters.html#derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)"><code>Object­Converters​.derived­Set(Set, Object­Converter)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)">
<h3>derivedMap</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;SK,<wbr>
SV,<wbr>
K,<wbr>
V&gt;</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;K,<wbr>V&gt;</span>&nbsp;<span class="element-name">derivedMap</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;SK,<wbr>SV&gt;&nbsp;storage,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a>&lt;SK,<wbr>K&gt;&nbsp;keyConverter,
<a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a>&lt;SV,<wbr>V&gt;&nbsp;valueConverter)</span></div>
<div class="block">Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.
Conversions from the original entries to the derived entries are performed when needed
by invoking the <a href="../ObjectConverter.html#apply(S)"><code>Object­Converter​.apply(Object)</code></a> method on the given converters.
Those conversions are repeated every time a <code>Map</code> method is invoked; there is no cache.
Consequently, any change in the original map is immediately visible in the derived map,
and conversely.
<p>The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#put(K,V)" title="class or interface in java.util" class="external-link"><code>Map​.put(K,V)</code></a> method is supported only if the given
converters are <a href="../../math/FunctionProperty.html#INVERTIBLE">invertible</a>.
An invertible converter is not mandatory for other <code>Map</code> operations like <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#get(java.lang.Object)" title="class or interface in java.util" class="external-link"><code>Map​.get(Object)</code></a>,
but some of them may be faster if the inverse converters are available.</p>
<p>The derived map may contain fewer entries than the original map if some keys are not convertible.
A key <var>K</var> is non-convertible if <code>key­Converter​.apply(K)</code> returns <code>null</code>.
As a consequence of this sentinel key usage, the derived map cannot contain <code>null</code> keys.
It may contain <code>null</code> values however.</p>
<p>The returned map can be serialized if the given map and converters are serializable.
The returned map is <strong>not</strong> thread-safe.</p>
<p>The returned map does not implement the <a href="CheckedContainer.html" title="interface in org.apache.sis.util.collection"><code>Checked­Container</code></a> interface since <code>Map</code>
is not a <code>Collection</code> sub-type, but the derived map <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#keySet()" title="class or interface in java.util" class="external-link">key set</a> and
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#entrySet()" title="class or interface in java.util" class="external-link">entry set</a> do.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>SK</code> - the type of keys in the storage map.</dd>
<dd><code>SV</code> - the type of values in the storage map.</dd>
<dd><code>K</code> - the type of keys in the derived map.</dd>
<dd><code>V</code> - the type of values in the derived map.</dd>
<dt>Parameters:</dt>
<dd><code>storage</code> - the storage map containing the original entries, or <code>null</code>.</dd>
<dd><code>key­Converter</code> - the converter from the keys in the storage map to the keys in the derived map.</dd>
<dd><code>value­Converter</code> - the converter from the values in the storage map to the values in the derived map.</dd>
<dt>Returns:</dt>
<dd>a view over the <code>storage</code> map containing all entries converted by the given converters,
or <code>null</code> if <code>storage</code> was null.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../ObjectConverters.html#derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)"><code>Object­Converters​.derived­Map(Map, Object­Converter, Object­Converter)</code></a></li>
<li><a href="../ObjectConverters.html#derivedKeys(java.util.Map,org.apache.sis.util.ObjectConverter,java.lang.Class)"><code>Object­Converters​.derived­Keys(Map, Object­Converter, Class)</code></a></li>
<li><a href="../ObjectConverters.html#derivedValues(java.util.Map,java.lang.Class,org.apache.sis.util.ObjectConverter)"><code>Object­Converters​.derived­Values(Map, Class, Object­Converter)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="property(java.util.Map,java.lang.Object,java.lang.Class)">
<h3>property</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;T&gt;</span>&nbsp;<span class="return-type">T</span>&nbsp;<span class="element-name">property</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;?,<wbr>?&gt;&nbsp;properties,
<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>&nbsp;key,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html" title="class or interface in java.lang" class="external-link">Class</a>&lt;T&gt;&nbsp;type)</span>
throws <span class="exceptions"><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></span></div>
<div class="block">Returns the value mapped to the given key casted to the given type,
or <code>null</code> if the map is null or does not contain a value for the key.
If the mapped value is non-null but cannot be casted to the given type, then this
method throws an <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"><code>Illegal­Argument­Exception</code></a> with a message of the form
<cite>"Property ‘<code>key</code>’ does not accept instances of ‘<code>value​.class</code>’."</cite>.
<p>This is a helper method for processing a <code>Map</code> argument containing property values of various
kinds, as in the <a href="../../../../../../org.apache.sis.referencing/org/apache/sis/referencing/AbstractIdentifiedObject.html#%3Cinit%3E(java.util.Map)"><code>Abstract­Identified­Object</code></a> constructor.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>T</code> - the compile-time value of the <code>type</code> argument.</dd>
<dt>Parameters:</dt>
<dd><code>properties</code> - the map of properties from which to get a value, or <code>null</code> if none.</dd>
<dd><code>key</code> - the key of the property value to return. Can be <code>null</code> if the map supports null key.</dd>
<dd><code>type</code> - the expected type of the property value. Cannot be null.</dd>
<dt>Returns:</dt>
<dd>the property value for the given key casted to the given type, or <code>null</code> if none.</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">Illegal­Argument­Exception</a></code> - if a non-null property value exists for the given key but can
not be casted to the given type.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../ArgumentChecks.html#ensureCanCast(java.lang.String,java.lang.Class,java.lang.Object)"><code>Argument­Checks​.ensure­Can­Cast(String, Class, Object)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="hashMapCapacity(int)">
<h3>hashMapCapacity</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">hashMapCapacity</span><wbr><span class="parameters">(int&nbsp;count)</span></div>
<div class="block">Returns the capacity to be given to the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#%3Cinit%3E(int)" title="class or interface in java.util" class="external-link"><code>Hash­Map</code></a>
constructor for holding the given number of elements. This method computes the capacity
for the default <cite>load factor</cite>, which is 0.75.
<p>The same calculation can be used for <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/LinkedHashMap.html" title="class or interface in java.util" class="external-link"><code>Linked­Hash­Map</code></a> and
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashSet.html" title="class or interface in java.util" class="external-link"><code>Hash­Set</code></a> as well, which are built on top of <code>Hash­Map</code>.
However, it is not needed for <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/IdentityHashMap.html" title="class or interface in java.util" class="external-link"><code>Identity­Hash­Map</code></a>.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>count</code> - the number of elements to be put into the hash map or hash set.</dd>
<dt>Returns:</dt>
<dd>the minimal initial capacity to be given to the hash map constructor.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="compare(java.util.Iterator,java.util.Iterator)">
<h3>compare</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="type-parameters">&lt;E extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a>&lt;E&gt;&gt;</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">compare</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;E&gt;&nbsp;it1,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Iterator.html" title="class or interface in java.util" class="external-link">Iterator</a>&lt;? extends E&gt;&nbsp;it2)</span></div>
<div class="block">Compares element-by-element the values provided by two iterators, in iteration order. Let <code>o1</code> be an
element from the first iterator and <code>o2</code> the element at the same position from the second iterator.
This method returns the result of the first <code>o1​.compare­To(o2)</code> call which returned a value different
than zero. If all <code>o1​.compare­To(o2)</code> calls returned zero, then this method returns -1 if <code>it1</code>
iteration finished before <code>it2</code>, +1 if <code>it2</code> iteration finished before <code>it1</code>, or 0 if both
iterators finished at the same time.
<p>Iterators may return null elements. Null elements are considered "after" any non-null element.</p></div>
<dl class="notes">
<dt>Type Parameters:</dt>
<dd><code>E</code> - the type of elements returned by the iterators.</dd>
<dt>Parameters:</dt>
<dd><code>it1</code> - the first iterator (cannot be null).</dd>
<dd><code>it2</code> - the second iterator (cannot be null).</dd>
<dt>Returns:</dt>
<dd>-1 if the content given by the first iterator is considered "before" the content given by the second
iterator, +1 if considered "after", or 0 if considered equal.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>