| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 --> |
| <title>Containers (Apache SIS 1.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2019-09-20"> |
| <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="../../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Containers (Apache SIS 1.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = false; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Containers.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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.sis.util.collection</a></div> |
| <h2 title="Class Containers" class="title">Class Containers</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../Static.html" title="class in org.apache.sis.util">Static</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>Containers</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public final class <span class="typeNameLabel">Containers</span> |
| extends <a href="../Static.html" title="class in org.apache.sis.util">Static</a></pre> |
| <div class="block">Static methods working on <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>Collection</code></a> or <a href="CheckedContainer.html" title="interface in org.apache.sis.util.collection"><code>CheckedContainer</code></a> objects. |
| Unless otherwise noted in the javadoc, every collections returned by the methods |
| in this class implement the <code>CheckedContainer</code> interface.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>0.3</dd> |
| |
| <p><font size="-1">Defined in the <code>sis-utility</code> module</font></p> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static <E extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><E>><br>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compare(java.util.Iterator,java.util.Iterator)">compare</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util" class="externalLink">Iterator</a><E> it1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util" class="externalLink">Iterator</a><? extends E> it2)</code></th> |
| <td class="colLast"> |
| <div class="block">Compares element-by-element the values provided by two iterators, in iteration order.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static <SK,​SV,​K,​V><br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)">derivedMap</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><SK,​SV> storage, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><SK,​K> keyConverter, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><SV,​V> valueConverter)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a map whose keys and values are derived <cite>on-the-fly</cite> from the given map.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static <S,​E><br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)">derivedSet</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><S> storage, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><S,​E> converter)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a set whose elements are derived <cite>on-the-fly</cite> from the given set.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashMapCapacity(int)">hashMapCapacity</a></span>​(int count)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the capacity to be given to the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html?is-external=true#%3Cinit%3E(int)" title="class or interface in java.util" class="externalLink"><code>HashMap</code></a> |
| constructor for holding the given number of elements.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNullOrEmpty(java.util.Collection)">isNullOrEmpty</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><?> collection)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given collection is either null or |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">empty</a>.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNullOrEmpty(java.util.Map)">isNullOrEmpty</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><?,​?> map)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns <code>true</code> if the given map is either null or <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">empty</a>.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <T> T</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#property(java.util.Map,java.lang.Object,java.lang.Class)">property</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><?,​?> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> key, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><T> type)</code></th> |
| <td class="colLast"> |
| <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> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><? extends E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unmodifiableList(E...)">unmodifiableList</a></span>​(E... array)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an unmodifiable view of the given array.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><? extends E></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unmodifiableList(E%5B%5D,int,int)">unmodifiableList</a></span>​(E[] array, |
| int lower, |
| int upper)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns an unmodifiable view of a subregion of the given array.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="isNullOrEmpty(java.util.Collection)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isNullOrEmpty</h4> |
| <pre class="methodSignature">public static boolean isNullOrEmpty​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util" class="externalLink">Collection</a><?> collection)</pre> |
| <div class="block">Returns <code>true</code> if the given collection is either null or |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">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/javase/8/docs/api/java/util/Collection.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">empty</a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>collection</code> - the collection to test, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given collection is null or empty, or <code>false</code> otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="isNullOrEmpty(java.util.Map)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isNullOrEmpty</h4> |
| <pre class="methodSignature">public static boolean isNullOrEmpty​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><?,​?> map)</pre> |
| <div class="block">Returns <code>true</code> if the given map is either null or <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">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/javase/8/docs/api/java/util/Map.html?is-external=true#isEmpty()" title="class or interface in java.util" class="externalLink">empty</a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>map</code> - the map to test, or <code>null</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if the given map is null or empty, or <code>false</code> otherwise.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="unmodifiableList(java.lang.Object[])"> |
| <!-- --> |
| </a><a id="unmodifiableList(E...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>unmodifiableList</h4> |
| <pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/SafeVarargs.html?is-external=true" title="class or interface in java.lang" class="externalLink">@SafeVarargs</a> |
| public static <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><? extends E> unmodifiableList​(E... array)</pre> |
| <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>CheckedContainer</code></a> interface. The value returned by |
| its <a href="CheckedContainer.html#getElementType()"><code>CheckedContainer.getElementType()</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><? extends E></code> instead than <code><E></code>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the base type of elements in the list.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the array to wrap, or <code>null</code> if none.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given array wrapped in an unmodifiable list, or <code>null</code> if the given array was null.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Arrays.html?is-external=true#asList(T...)" title="class or interface in java.util" class="externalLink"><code>Arrays.asList(Object[])</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="unmodifiableList(java.lang.Object[],int,int)"> |
| <!-- --> |
| </a><a id="unmodifiableList(E[],int,int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>unmodifiableList</h4> |
| <pre class="methodSignature">public static <E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><? extends E> unmodifiableList​(E[] array, |
| int lower, |
| int upper)</pre> |
| <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>CheckedContainer</code></a> interface. The value returned by |
| its <a href="CheckedContainer.html#getElementType()"><code>CheckedContainer.getElementType()</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><? extends E></code> instead than <code><E></code>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type of elements in the list.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>array</code> - the array to wrap (can not 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><span class="returnLabel">Returns:</span></dt> |
| <dd>the given array wrapped in an unmodifiable list.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IndexOutOfBoundsException</a></code> - if the lower or upper value are out of bounds.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>derivedSet</h4> |
| <pre class="methodSignature">public static <S,​E> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><E> derivedSet​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a><S> storage, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><S,​E> converter)</pre> |
| <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>ObjectConverter.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/javase/8/docs/api/java/util/Set.html?is-external=true#add(E)" title="class or interface in java.util" class="externalLink"><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/javase/8/docs/api/java/util/Set.html?is-external=true#contains(java.lang.Object)" title="class or interface in java.util" class="externalLink"><code>contains</code></a> and <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true#remove(java.lang.Object)" title="class or interface in java.util" class="externalLink"><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 can not 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> |
| <dt><span class="paramLabel">Type Parameters:</span></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><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></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><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../ObjectConverters.html#derivedSet(java.util.Set,org.apache.sis.util.ObjectConverter)"><code>ObjectConverters.derivedSet(Set, ObjectConverter)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>derivedMap</h4> |
| <pre class="methodSignature">public static <SK,​SV,​K,​V> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><K,​V> derivedMap​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><SK,​SV> storage, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><SK,​K> keyConverter, |
| <a href="../ObjectConverter.html" title="interface in org.apache.sis.util">ObjectConverter</a><SV,​V> valueConverter)</pre> |
| <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>ObjectConverter.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/javase/8/docs/api/java/util/Map.html?is-external=true#put(K,V)" title="class or interface in java.util" class="externalLink"><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/javase/8/docs/api/java/util/Map.html?is-external=true#get(java.lang.Object)" title="class or interface in java.util" class="externalLink"><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>keyConverter.apply(K)</code> returns <code>null</code>. |
| As a consequence of this sentinel key usage, the derived map can not 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>CheckedContainer</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/javase/8/docs/api/java/util/Map.html?is-external=true#keySet()" title="class or interface in java.util" class="externalLink">key set</a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#entrySet()" title="class or interface in java.util" class="externalLink">entry set</a> do.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></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><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>storage</code> - the storage map containing the original entries, or <code>null</code>.</dd> |
| <dd><code>keyConverter</code> - the converter from the keys in the storage map to the keys in the derived map.</dd> |
| <dd><code>valueConverter</code> - the converter from the values in the storage map to the values in the derived map.</dd> |
| <dt><span class="returnLabel">Returns:</span></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><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../ObjectConverters.html#derivedMap(java.util.Map,org.apache.sis.util.ObjectConverter,org.apache.sis.util.ObjectConverter)"><code>ObjectConverters.derivedMap(Map, ObjectConverter, ObjectConverter)</code></a>, |
| <a href="../ObjectConverters.html#derivedKeys(java.util.Map,org.apache.sis.util.ObjectConverter,java.lang.Class)"><code>ObjectConverters.derivedKeys(Map, ObjectConverter, Class)</code></a>, |
| <a href="../ObjectConverters.html#derivedValues(java.util.Map,java.lang.Class,org.apache.sis.util.ObjectConverter)"><code>ObjectConverters.derivedValues(Map, Class, ObjectConverter)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="property(java.util.Map,java.lang.Object,java.lang.Class)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>property</h4> |
| <pre class="methodSignature">public static <T> T property​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util" class="externalLink">Map</a><?,​?> properties, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a> key, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang" class="externalLink">Class</a><T> type) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></pre> |
| <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 can not be casted to the given type, then this |
| method throws an <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>IllegalArgumentException</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="../../referencing/AbstractIdentifiedObject.html#%3Cinit%3E(java.util.Map)"><code>AbstractIdentifiedObject</code></a> constructor.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - the compile-time value of the <code>type</code> argument.</dd> |
| <dt><span class="paramLabel">Parameters:</span></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. Can not be null.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the property value for the given key casted to the given type, or <code>null</code> if none.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">IllegalArgumentException</a></code> - if a non-null property value exists for the given key but can |
| not be casted to the given type.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../ArgumentChecks.html#ensureCanCast(java.lang.String,java.lang.Class,java.lang.Object)"><code>ArgumentChecks.ensureCanCast(String, Class, Object)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="hashMapCapacity(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashMapCapacity</h4> |
| <pre class="methodSignature">public static int hashMapCapacity​(int count)</pre> |
| <div class="block">Returns the capacity to be given to the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html?is-external=true#%3Cinit%3E(int)" title="class or interface in java.util" class="externalLink"><code>HashMap</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/javase/8/docs/api/java/util/LinkedHashMap.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>LinkedHashMap</code></a> and |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/HashSet.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>HashSet</code></a> as well, which are built on top of <code>HashMap</code>. |
| However it is not needed for <a href="https://docs.oracle.com/javase/8/docs/api/java/util/IdentityHashMap.html?is-external=true" title="class or interface in java.util" class="externalLink"><code>IdentityHashMap</code></a>.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>count</code> - the number of elements to be put into the hash map or hash set.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the minimal initial capacity to be given to the hash map constructor.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="compare(java.util.Iterator,java.util.Iterator)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>compare</h4> |
| <pre class="methodSignature">public static <E extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Comparable</a><E>> int compare​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util" class="externalLink">Iterator</a><E> it1, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util" class="externalLink">Iterator</a><? extends E> it2)</pre> |
| <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.compareTo(o2)</code> call which returned a value different |
| than zero. If all <code>o1.compareTo(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 in same time. |
| |
| <p>Iterators may return null elements. Null elements are considered "after" any non-null element.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>E</code> - the type of elements returned by the iterators.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>it1</code> - the first iterator (can not be null).</dd> |
| <dd><code>it2</code> - the second iterator (can not be null).</dd> |
| <dt><span class="returnLabel">Returns:</span></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><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Containers.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">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2010–2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |