| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (14.0.2) on Thu Aug 20 21:25:36 CDT 2020 --> |
| <title>Bag (Eclipse Collections - 10.4.0)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-08-20"> |
| <meta name="description" content="declaration: package: org.eclipse.collections.api.bag, interface: Bag"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.4.1.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.js"></script> |
| </head> |
| <body class="class-declaration"> |
| <script type="text/javascript">var data = {"i0":18,"i1":6,"i2":6,"i3":18,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":18,"i13":18,"i14":6,"i15":6,"i16":6,"i17":6,"i18":18,"i19":6,"i20":6,"i21":6,"i22":6,"i23":18,"i24":18,"i25":18,"i26":18,"i27":6,"i28":6,"i29":6,"i30":6,"i31":6,"i32":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flexBox"> |
| <header role="banner" class="flexHeader"> |
| <nav role="navigation"> |
| <!-- ========= 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/Bag.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"> |
| <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> |
| <div class="navListSearch"><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <div class="skipNav"><a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| </nav> |
| </header> |
| <div class="flexContent"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.eclipse.collections.api.bag</a></div> |
| <h1 title="Interface Bag" class="title">Interface Bag<T></h1> |
| </div> |
| <div class="contentContainer"> |
| <section class="description"> |
| <dl> |
| <dt>All Superinterfaces:</dt> |
| <dd><code><a href="../InternalIterable.html" title="interface in org.eclipse.collections.api">InternalIterable</a><T></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><T></code>, <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><T></code></dd> |
| </dl> |
| <dl> |
| <dt>All Known Subinterfaces:</dt> |
| <dd><code><a href="ImmutableBag.html" title="interface in org.eclipse.collections.api.bag">ImmutableBag</a><T></code>, <code><a href="ImmutableBagIterable.html" title="interface in org.eclipse.collections.api.bag">ImmutableBagIterable</a><T></code>, <code><a href="sorted/ImmutableSortedBag.html" title="interface in org.eclipse.collections.api.bag.sorted">ImmutableSortedBag</a><T></code>, <code><a href="MultiReaderBag.html" title="interface in org.eclipse.collections.api.bag">MultiReaderBag</a><T></code>, <code><a href="MutableBag.html" title="interface in org.eclipse.collections.api.bag">MutableBag</a><T></code>, <code><a href="MutableBagIterable.html" title="interface in org.eclipse.collections.api.bag">MutableBagIterable</a><T></code>, <code><a href="sorted/MutableSortedBag.html" title="interface in org.eclipse.collections.api.bag.sorted">MutableSortedBag</a><T></code>, <code><a href="sorted/SortedBag.html" title="interface in org.eclipse.collections.api.bag.sorted">SortedBag</a><T></code>, <code><a href="UnsortedBag.html" title="interface in org.eclipse.collections.api.bag">UnsortedBag</a><T></code></dd> |
| </dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><code><a href="../../impl/bag/AbstractBag.html" title="class in org.eclipse.collections.impl.bag">AbstractBag</a></code>, <code><a href="../../impl/bag/mutable/AbstractHashBag.html" title="class in org.eclipse.collections.impl.bag.mutable">AbstractHashBag</a></code>, <code><a href="../../impl/bag/immutable/AbstractImmutableBag.html" title="class in org.eclipse.collections.impl.bag.immutable">AbstractImmutableBag</a></code>, <code><a href="../../impl/bag/immutable/AbstractImmutableBagIterable.html" title="class in org.eclipse.collections.impl.bag.immutable">AbstractImmutableBagIterable</a></code>, <code><a href="../../impl/bag/mutable/AbstractMutableBag.html" title="class in org.eclipse.collections.impl.bag.mutable">AbstractMutableBag</a></code>, <code><a href="../../impl/bag/mutable/AbstractMutableBagIterable.html" title="class in org.eclipse.collections.impl.bag.mutable">AbstractMutableBagIterable</a></code>, <code><a href="../../impl/bag/sorted/mutable/AbstractMutableSortedBag.html" title="class in org.eclipse.collections.impl.bag.sorted.mutable">AbstractMutableSortedBag</a></code>, <code><a href="../../impl/bag/mutable/HashBag.html" title="class in org.eclipse.collections.impl.bag.mutable">HashBag</a></code>, <code><a href="../../impl/bag/strategy/mutable/HashBagWithHashingStrategy.html" title="class in org.eclipse.collections.impl.bag.strategy.mutable">HashBagWithHashingStrategy</a></code>, <code><a href="../../impl/bag/immutable/ImmutableArrayBag.html" title="class in org.eclipse.collections.impl.bag.immutable">ImmutableArrayBag</a></code>, <code><a href="../../impl/bag/immutable/ImmutableHashBag.html" title="class in org.eclipse.collections.impl.bag.immutable">ImmutableHashBag</a></code>, <code><a href="../../impl/bag/mutable/MultiReaderHashBag.html" title="class in org.eclipse.collections.impl.bag.mutable">MultiReaderHashBag</a></code>, <code><a href="../../impl/bag/mutable/SynchronizedBag.html" title="class in org.eclipse.collections.impl.bag.mutable">SynchronizedBag</a></code>, <code><a href="../../impl/bag/sorted/mutable/SynchronizedSortedBag.html" title="class in org.eclipse.collections.impl.bag.sorted.mutable">SynchronizedSortedBag</a></code>, <code><a href="../../impl/bag/sorted/mutable/TreeBag.html" title="class in org.eclipse.collections.impl.bag.sorted.mutable">TreeBag</a></code>, <code><a href="../../impl/bag/mutable/UnmodifiableBag.html" title="class in org.eclipse.collections.impl.bag.mutable">UnmodifiableBag</a></code>, <code><a href="../../impl/bag/sorted/mutable/UnmodifiableSortedBag.html" title="class in org.eclipse.collections.impl.bag.sorted.mutable">UnmodifiableSortedBag</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public interface <span class="typeNameLabel">Bag<T></span> |
| extends <a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><T></pre> |
| <div class="block">A Bag is a Collection whose elements are unordered and may contain duplicate entries. It varies from |
| MutableCollection in that it adds a protocol for determining, adding, and removing the number of occurrences for an |
| item.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li class="blockList"> |
| <section class="methodSummary"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h2>Method Summary</h2> |
| <div class="memberSummary"> |
| <div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t3" class="tableTab" onclick="show(4);">Abstract Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t5" class="tableTab" onclick="show(16);">Default Methods</button></div> |
| <div id="memberSummary_tabpanel" role="tabpanel"> |
| <table aria-labelledby="t0"> |
| <thead> |
| <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> |
| </thead> |
| <tbody> |
| <tr class="altColor" id="i0"> |
| <td class="colFirst"><code>default <K,​ |
| V,​ |
| R extends <a href="../map/MutableMapIterable.html" title="interface in org.eclipse.collections.api.map">MutableMapIterable</a><K,​ |
| V>><br>R</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#aggregateBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.function.Function2,R)">aggregateBy</a></span>​(<a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends K> groupBy, |
| <a href="../block/function/Function0.html" title="interface in org.eclipse.collections.api.block.function">Function0</a><? extends V> zeroValueFactory, |
| <a href="../block/function/Function2.html" title="interface in org.eclipse.collections.api.block.function">Function2</a><? super V,​? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> nonMutatingAggregator, |
| R target)</code></th> |
| <td class="colLast"> |
| <div class="block">Applies an aggregate function over the iterable grouping results into the target map based on the specific |
| groupBy function.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i1"> |
| <td class="colFirst"><code><a href="../list/ListIterable.html" title="interface in org.eclipse.collections.api.list">ListIterable</a><<a href="../tuple/primitive/ObjectIntPair.html" title="interface in org.eclipse.collections.api.tuple.primitive">ObjectIntPair</a><<a href="Bag.html" title="type parameter in Bag">T</a>>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#bottomOccurrences(int)">bottomOccurrences</a></span>​(int count)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <code>count</code> least frequently occurring items.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i2"> |
| <td class="colFirst"><code><V> <a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><V></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#collectWithOccurrences(org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction)">collectWithOccurrences</a></span>​(<a href="../block/function/primitive/ObjectIntToObjectFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">ObjectIntToObjectFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Iterates over the unique elements and their occurrences and collects the results of applying the specified function.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i3"> |
| <td class="colFirst"><code>default <V,​ |
| R extends <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><V>><br>R</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#collectWithOccurrences(org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction,R)">collectWithOccurrences</a></span>​(<a href="../block/function/primitive/ObjectIntToObjectFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">ObjectIntToObjectFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function, |
| R target)</code></th> |
| <td class="colLast"> |
| <div class="block">Iterates over the unique elements and their occurrences and collects the results of applying the |
| specified function into the target collection.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i4"> |
| <td class="colFirst"><code>boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(<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> object)</code></th> |
| <td class="colLast"> |
| <div class="block">Two bags <code>b1</code> and <code>b2</code> are equal if <code>m1.toMapOfItemToCount().equals(m2.toMapOfItemToCount())</code>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i5"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#forEachWithOccurrences(org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure)">forEachWithOccurrences</a></span>​(<a href="../block/procedure/primitive/ObjectIntProcedure.html" title="interface in org.eclipse.collections.api.block.procedure.primitive">ObjectIntProcedure</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> procedure)</code></th> |
| <td class="colLast"> |
| <div class="block">For each distinct item, with the number of occurrences, execute the specified procedure.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i6"> |
| <td class="colFirst"><code><V> <a href="../multimap/bag/BagMultimap.html" title="interface in org.eclipse.collections.api.multimap.bag">BagMultimap</a><V,​<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#groupBy(org.eclipse.collections.api.block.function.Function)">groupBy</a></span>​(<a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function)</code></th> |
| <td class="colLast"> |
| <div class="block">For each element of the iterable, the function is evaluated and the results of these evaluations are collected |
| into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) |
| species of collection as the source iterable.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i7"> |
| <td class="colFirst"><code><V> <a href="../multimap/bag/BagMultimap.html" title="interface in org.eclipse.collections.api.multimap.bag">BagMultimap</a><V,​<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#groupByEach(org.eclipse.collections.api.block.function.Function)">groupByEach</a></span>​(<a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><V>> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Similar to <a href="../RichIterable.html#groupBy(org.eclipse.collections.api.block.function.Function)"><code>RichIterable.groupBy(Function)</code></a>, except the result of evaluating function will return a collection of keys |
| for each value.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i8"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the hash code for this Bag, defined as <em>this.<a href="#toMapOfItemToCount()"><code>toMapOfItemToCount()</code></a>.hashCode()</em>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i9"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#occurrencesOf(java.lang.Object)">occurrencesOf</a></span>​(<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> item)</code></th> |
| <td class="colLast"> |
| <div class="block">The occurrences of a distinct item in the bag.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i10"> |
| <td class="colFirst"><code><a href="../partition/bag/PartitionBag.html" title="interface in org.eclipse.collections.api.partition.bag">PartitionBag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#partition(org.eclipse.collections.api.block.predicate.Predicate)">partition</a></span>​(<a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</code></th> |
| <td class="colLast"> |
| <div class="block">Filters a collection into a PartitionedIterable based on the evaluation of the predicate.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i11"> |
| <td class="colFirst"><code><P> <a href="../partition/bag/PartitionBag.html" title="interface in org.eclipse.collections.api.partition.bag">PartitionBag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#partitionWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">partitionWith</a></span>​(<a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</code></th> |
| <td class="colLast"> |
| <div class="block">Filters a collection into a PartitionIterable based on the evaluation of the predicate.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i12"> |
| <td class="colFirst"><code>default <R> R</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reduceInPlace(java.util.function.Supplier,java.util.function.BiConsumer)">reduceInPlace</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Supplier</a><R> supplier, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">BiConsumer</a><R,​? super <a href="Bag.html" title="type parameter in Bag">T</a>> accumulator)</code></th> |
| <td class="colLast"> |
| <div class="block">This method produces the equivalent result as <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true#collect(java.util.function.Supplier,java.util.function.BiConsumer,java.util.function.BiConsumer)" title="class or interface in java.util.stream" class="externalLink"><code>Stream.collect(Supplier, BiConsumer, BiConsumer)</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i13"> |
| <td class="colFirst"><code>default <R,​ |
| A> R</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reduceInPlace(java.util.stream.Collector)">reduceInPlace</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collector.html?is-external=true" title="class or interface in java.util.stream" class="externalLink">Collector</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​A,​R> collector)</code></th> |
| <td class="colLast"> |
| <div class="block">This method produces the equivalent result as <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true#collect(java.util.stream.Collector)" title="class or interface in java.util.stream" class="externalLink"><code>Stream.collect(Collector)</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i14"> |
| <td class="colFirst"><code><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reject(org.eclipse.collections.api.block.predicate.Predicate)">reject</a></span>​(<a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns all elements of the source collection that return false when evaluating of the predicate.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i15"> |
| <td class="colFirst"><code><P> <a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">rejectWith</a></span>​(<a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</code></th> |
| <td class="colLast"> |
| <div class="block">Similar to <a href="../RichIterable.html#reject(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.reject(Predicate)</code></a>, except with an evaluation parameter for the second generic argument in <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i16"> |
| <td class="colFirst"><code><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#select(org.eclipse.collections.api.block.predicate.Predicate)">select</a></span>​(<a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns all elements of the source collection that return true when evaluating the predicate.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i17"> |
| <td class="colFirst"><code><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#selectByOccurrences(org.eclipse.collections.api.block.predicate.primitive.IntPredicate)">selectByOccurrences</a></span>​(<a href="../block/predicate/primitive/IntPredicate.html" title="interface in org.eclipse.collections.api.block.predicate.primitive">IntPredicate</a> predicate)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns all elements of the bag that have a number of occurrences that satisfy the predicate.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i18"> |
| <td class="colFirst"><code>default <a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#selectDuplicates()">selectDuplicates</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns all elements of the bag that have more than one occurrence.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i19"> |
| <td class="colFirst"><code><S> <a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><S></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#selectInstancesOf(java.lang.Class)">selectInstancesOf</a></span>​(<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><S> clazz)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns all elements of the source collection that are instances of the Class <code>clazz</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i20"> |
| <td class="colFirst"><code><a href="../set/SetIterable.html" title="interface in org.eclipse.collections.api.set">SetIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#selectUnique()">selectUnique</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a set containing all elements of the bag that have exactly one occurrence.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i21"> |
| <td class="colFirst"><code><P> <a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#selectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">selectWith</a></span>​(<a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</code></th> |
| <td class="colLast"> |
| <div class="block">Similar to <a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.select(Predicate)</code></a>, except with an evaluation parameter for the second generic argument in <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i22"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#sizeDistinct()">sizeDistinct</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">The size of the Bag when counting only distinct elements.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i23"> |
| <td class="colFirst"><code>default <a href="https://docs.oracle.com/javase/8/docs/api/java/util/DoubleSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">DoubleSummaryStatistics</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#summarizeDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">summarizeDouble</a></span>​(<a href="../block/function/primitive/DoubleFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">DoubleFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the result of summarizing the value returned from applying the DoubleFunction to |
| each element of the iterable.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i24"> |
| <td class="colFirst"><code>default <a href="https://docs.oracle.com/javase/8/docs/api/java/util/DoubleSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">DoubleSummaryStatistics</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#summarizeFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">summarizeFloat</a></span>​(<a href="../block/function/primitive/FloatFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">FloatFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the result of summarizing the value returned from applying the FloatFunction to |
| each element of the iterable.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i25"> |
| <td class="colFirst"><code>default <a href="https://docs.oracle.com/javase/8/docs/api/java/util/IntSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">IntSummaryStatistics</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#summarizeInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">summarizeInt</a></span>​(<a href="../block/function/primitive/IntFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">IntFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the result of summarizing the value returned from applying the IntFunction to |
| each element of the iterable.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i26"> |
| <td class="colFirst"><code>default <a href="https://docs.oracle.com/javase/8/docs/api/java/util/LongSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">LongSummaryStatistics</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#summarizeLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">summarizeLong</a></span>​(<a href="../block/function/primitive/LongFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">LongFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the result of summarizing the value returned from applying the LongFunction to |
| each element of the iterable.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i27"> |
| <td class="colFirst"><code><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#tap(org.eclipse.collections.api.block.procedure.Procedure)">tap</a></span>​(<a href="../block/procedure/Procedure.html" title="interface in org.eclipse.collections.api.block.procedure">Procedure</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> procedure)</code></th> |
| <td class="colLast"> |
| <div class="block">Executes the Procedure for each element in the iterable and returns <code>this</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i28"> |
| <td class="colFirst"><code><a href="ImmutableBagIterable.html" title="interface in org.eclipse.collections.api.bag">ImmutableBagIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toImmutable()">toImmutable</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor" id="i29"> |
| <td class="colFirst"><code><a href="../map/MapIterable.html" title="interface in org.eclipse.collections.api.map">MapIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>,​<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink">Integer</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toMapOfItemToCount()">toMapOfItemToCount</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the Bag to a Map of the Item type to its count as an Integer.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i30"> |
| <td class="colFirst"><code><a href="../list/ListIterable.html" title="interface in org.eclipse.collections.api.list">ListIterable</a><<a href="../tuple/primitive/ObjectIntPair.html" title="interface in org.eclipse.collections.api.tuple.primitive">ObjectIntPair</a><<a href="Bag.html" title="type parameter in Bag">T</a>>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#topOccurrences(int)">topOccurrences</a></span>​(int count)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the <code>count</code> most frequently occurring items.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i31"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toStringOfItemToCount()">toStringOfItemToCount</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a string representation of this bag.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i32"> |
| <td class="colFirst"><code><a href="../set/SetIterable.html" title="interface in org.eclipse.collections.api.set">SetIterable</a><<a href="../tuple/Pair.html" title="interface in org.eclipse.collections.api.tuple">Pair</a><<a href="Bag.html" title="type parameter in Bag">T</a>,​<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink">Integer</a>>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#zipWithIndex()">zipWithIndex</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Zips this <code>RichIterable</code> with its indices.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="inheritedList"> |
| <h3>Methods inherited from interface org.eclipse.collections.api.<a href="../InternalIterable.html" title="interface in org.eclipse.collections.api">InternalIterable</a></h3> |
| <a id="methods.inherited.from.class.org.eclipse.collections.api.InternalIterable"> |
| <!-- --> |
| </a><code><a href="../InternalIterable.html#forEach(java.util.function.Consumer)">forEach</a>, <a href="../InternalIterable.html#forEachWith(org.eclipse.collections.api.block.procedure.Procedure2,P)">forEachWith</a>, <a href="../InternalIterable.html#forEachWithIndex(org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure)">forEachWithIndex</a></code></div> |
| <div class="inheritedList"> |
| <h3>Methods inherited from interface java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a></h3> |
| <a id="methods.inherited.from.class.java.lang.Iterable"> |
| <!-- --> |
| </a><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#iterator()" title="class or interface in java.lang" class="externalLink">iterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#spliterator()" title="class or interface in java.lang" class="externalLink">spliterator</a></code></div> |
| <div class="inheritedList"> |
| <h3>Methods inherited from interface org.eclipse.collections.api.<a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a></h3> |
| <a id="methods.inherited.from.class.org.eclipse.collections.api.RichIterable"> |
| <!-- --> |
| </a><code><a href="../RichIterable.html#aggregateBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.function.Function2)">aggregateBy</a>, <a href="../RichIterable.html#aggregateInPlaceBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.procedure.Procedure2)">aggregateInPlaceBy</a>, <a href="../RichIterable.html#allSatisfy(org.eclipse.collections.api.block.predicate.Predicate)">allSatisfy</a>, <a href="../RichIterable.html#allSatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">allSatisfyWith</a>, <a href="../RichIterable.html#anySatisfy(org.eclipse.collections.api.block.predicate.Predicate)">anySatisfy</a>, <a href="../RichIterable.html#anySatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">anySatisfyWith</a>, <a href="../RichIterable.html#appendString(java.lang.Appendable)">appendString</a>, <a href="../RichIterable.html#appendString(java.lang.Appendable,java.lang.String)">appendString</a>, <a href="../RichIterable.html#appendString(java.lang.Appendable,java.lang.String,java.lang.String,java.lang.String)">appendString</a>, <a href="../RichIterable.html#asLazy()">asLazy</a>, <a href="../RichIterable.html#chunk(int)">chunk</a>, <a href="../RichIterable.html#collect(org.eclipse.collections.api.block.function.Function)">collect</a>, <a href="../RichIterable.html#collect(org.eclipse.collections.api.block.function.Function,R)">collect</a>, <a href="../RichIterable.html#collectBoolean(org.eclipse.collections.api.block.function.primitive.BooleanFunction)">collectBoolean</a>, <a href="../RichIterable.html#collectBoolean(org.eclipse.collections.api.block.function.primitive.BooleanFunction,R)">collectBoolean</a>, <a href="../RichIterable.html#collectByte(org.eclipse.collections.api.block.function.primitive.ByteFunction)">collectByte</a>, <a href="../RichIterable.html#collectByte(org.eclipse.collections.api.block.function.primitive.ByteFunction,R)">collectByte</a>, <a href="../RichIterable.html#collectChar(org.eclipse.collections.api.block.function.primitive.CharFunction)">collectChar</a>, <a href="../RichIterable.html#collectChar(org.eclipse.collections.api.block.function.primitive.CharFunction,R)">collectChar</a>, <a href="../RichIterable.html#collectDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">collectDouble</a>, <a href="../RichIterable.html#collectDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction,R)">collectDouble</a>, <a href="../RichIterable.html#collectFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">collectFloat</a>, <a href="../RichIterable.html#collectFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction,R)">collectFloat</a>, <a href="../RichIterable.html#collectIf(org.eclipse.collections.api.block.predicate.Predicate,org.eclipse.collections.api.block.function.Function)">collectIf</a>, <a href="../RichIterable.html#collectIf(org.eclipse.collections.api.block.predicate.Predicate,org.eclipse.collections.api.block.function.Function,R)">collectIf</a>, <a href="../RichIterable.html#collectInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">collectInt</a>, <a href="../RichIterable.html#collectInt(org.eclipse.collections.api.block.function.primitive.IntFunction,R)">collectInt</a>, <a href="../RichIterable.html#collectLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">collectLong</a>, <a href="../RichIterable.html#collectLong(org.eclipse.collections.api.block.function.primitive.LongFunction,R)">collectLong</a>, <a href="../RichIterable.html#collectShort(org.eclipse.collections.api.block.function.primitive.ShortFunction)">collectShort</a>, <a href="../RichIterable.html#collectShort(org.eclipse.collections.api.block.function.primitive.ShortFunction,R)">collectShort</a>, <a href="../RichIterable.html#collectWith(org.eclipse.collections.api.block.function.Function2,P)">collectWith</a>, <a href="../RichIterable.html#collectWith(org.eclipse.collections.api.block.function.Function2,P,R)">collectWith</a>, <a href="../RichIterable.html#contains(java.lang.Object)">contains</a>, <a href="../RichIterable.html#containsAll(java.util.Collection)">containsAll</a>, <a href="../RichIterable.html#containsAllArguments(java.lang.Object...)">containsAllArguments</a>, <a href="../RichIterable.html#containsAllIterable(java.lang.Iterable)">containsAllIterable</a>, <a href="../RichIterable.html#containsBy(org.eclipse.collections.api.block.function.Function,V)">containsBy</a>, <a href="../RichIterable.html#count(org.eclipse.collections.api.block.predicate.Predicate)">count</a>, <a href="../RichIterable.html#countBy(org.eclipse.collections.api.block.function.Function)">countBy</a>, <a href="../RichIterable.html#countBy(org.eclipse.collections.api.block.function.Function,R)">countBy</a>, <a href="../RichIterable.html#countByEach(org.eclipse.collections.api.block.function.Function)">countByEach</a>, <a href="../RichIterable.html#countByEach(org.eclipse.collections.api.block.function.Function,R)">countByEach</a>, <a href="../RichIterable.html#countByWith(org.eclipse.collections.api.block.function.Function2,P)">countByWith</a>, <a href="../RichIterable.html#countByWith(org.eclipse.collections.api.block.function.Function2,P,R)">countByWith</a>, <a href="../RichIterable.html#countWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">countWith</a>, <a href="../RichIterable.html#detect(org.eclipse.collections.api.block.predicate.Predicate)">detect</a>, <a href="../RichIterable.html#detectIfNone(org.eclipse.collections.api.block.predicate.Predicate,org.eclipse.collections.api.block.function.Function0)">detectIfNone</a>, <a href="../RichIterable.html#detectOptional(org.eclipse.collections.api.block.predicate.Predicate)">detectOptional</a>, <a href="../RichIterable.html#detectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">detectWith</a>, <a href="../RichIterable.html#detectWithIfNone(org.eclipse.collections.api.block.predicate.Predicate2,P,org.eclipse.collections.api.block.function.Function0)">detectWithIfNone</a>, <a href="../RichIterable.html#detectWithOptional(org.eclipse.collections.api.block.predicate.Predicate2,P)">detectWithOptional</a>, <a href="../RichIterable.html#each(org.eclipse.collections.api.block.procedure.Procedure)">each</a>, <a href="../RichIterable.html#flatCollect(org.eclipse.collections.api.block.function.Function)">flatCollect</a>, <a href="../RichIterable.html#flatCollect(org.eclipse.collections.api.block.function.Function,R)">flatCollect</a>, <a href="../RichIterable.html#flatCollectBoolean(org.eclipse.collections.api.block.function.Function,R)">flatCollectBoolean</a>, <a href="../RichIterable.html#flatCollectByte(org.eclipse.collections.api.block.function.Function,R)">flatCollectByte</a>, <a href="../RichIterable.html#flatCollectChar(org.eclipse.collections.api.block.function.Function,R)">flatCollectChar</a>, <a href="../RichIterable.html#flatCollectDouble(org.eclipse.collections.api.block.function.Function,R)">flatCollectDouble</a>, <a href="../RichIterable.html#flatCollectFloat(org.eclipse.collections.api.block.function.Function,R)">flatCollectFloat</a>, <a href="../RichIterable.html#flatCollectInt(org.eclipse.collections.api.block.function.Function,R)">flatCollectInt</a>, <a href="../RichIterable.html#flatCollectLong(org.eclipse.collections.api.block.function.Function,R)">flatCollectLong</a>, <a href="../RichIterable.html#flatCollectShort(org.eclipse.collections.api.block.function.Function,R)">flatCollectShort</a>, <a href="../RichIterable.html#flatCollectWith(org.eclipse.collections.api.block.function.Function2,P)">flatCollectWith</a>, <a href="../RichIterable.html#flatCollectWith(org.eclipse.collections.api.block.function.Function2,P,R)">flatCollectWith</a>, <a href="../RichIterable.html#forEach(org.eclipse.collections.api.block.procedure.Procedure)">forEach</a>, <a href="../RichIterable.html#getAny()">getAny</a>, <a href="../RichIterable.html#getFirst()">getFirst</a>, <a href="../RichIterable.html#getLast()">getLast</a>, <a href="../RichIterable.html#getOnly()">getOnly</a>, <a href="../RichIterable.html#groupBy(org.eclipse.collections.api.block.function.Function,R)">groupBy</a>, <a href="../RichIterable.html#groupByAndCollect(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function,R)">groupByAndCollect</a>, <a href="../RichIterable.html#groupByEach(org.eclipse.collections.api.block.function.Function,R)">groupByEach</a>, <a href="../RichIterable.html#groupByUniqueKey(org.eclipse.collections.api.block.function.Function)">groupByUniqueKey</a>, <a href="../RichIterable.html#groupByUniqueKey(org.eclipse.collections.api.block.function.Function,R)">groupByUniqueKey</a>, <a href="../RichIterable.html#injectInto(double,org.eclipse.collections.api.block.function.primitive.DoubleObjectToDoubleFunction)">injectInto</a>, <a href="../RichIterable.html#injectInto(float,org.eclipse.collections.api.block.function.primitive.FloatObjectToFloatFunction)">injectInto</a>, <a href="../RichIterable.html#injectInto(int,org.eclipse.collections.api.block.function.primitive.IntObjectToIntFunction)">injectInto</a>, <a href="../RichIterable.html#injectInto(long,org.eclipse.collections.api.block.function.primitive.LongObjectToLongFunction)">injectInto</a>, <a href="../RichIterable.html#injectInto(IV,org.eclipse.collections.api.block.function.Function2)">injectInto</a>, <a href="../RichIterable.html#into(R)">into</a>, <a href="../RichIterable.html#isEmpty()">isEmpty</a>, <a href="../RichIterable.html#makeString()">makeString</a>, <a href="../RichIterable.html#makeString(java.lang.String)">makeString</a>, <a href="../RichIterable.html#makeString(java.lang.String,java.lang.String,java.lang.String)">makeString</a>, <a href="../RichIterable.html#max()">max</a>, <a href="../RichIterable.html#max(java.util.Comparator)">max</a>, <a href="../RichIterable.html#maxBy(org.eclipse.collections.api.block.function.Function)">maxBy</a>, <a href="../RichIterable.html#maxByOptional(org.eclipse.collections.api.block.function.Function)">maxByOptional</a>, <a href="../RichIterable.html#maxOptional()">maxOptional</a>, <a href="../RichIterable.html#maxOptional(java.util.Comparator)">maxOptional</a>, <a href="../RichIterable.html#min()">min</a>, <a href="../RichIterable.html#min(java.util.Comparator)">min</a>, <a href="../RichIterable.html#minBy(org.eclipse.collections.api.block.function.Function)">minBy</a>, <a href="../RichIterable.html#minByOptional(org.eclipse.collections.api.block.function.Function)">minByOptional</a>, <a href="../RichIterable.html#minOptional()">minOptional</a>, <a href="../RichIterable.html#minOptional(java.util.Comparator)">minOptional</a>, <a href="../RichIterable.html#noneSatisfy(org.eclipse.collections.api.block.predicate.Predicate)">noneSatisfy</a>, <a href="../RichIterable.html#noneSatisfyWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">noneSatisfyWith</a>, <a href="../RichIterable.html#notEmpty()">notEmpty</a>, <a href="../RichIterable.html#reduce(java.util.function.BinaryOperator)">reduce</a>, <a href="../RichIterable.html#reject(org.eclipse.collections.api.block.predicate.Predicate,R)">reject</a>, <a href="../RichIterable.html#rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,P,R)">rejectWith</a>, <a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate,R)">select</a>, <a href="../RichIterable.html#selectWith(org.eclipse.collections.api.block.predicate.Predicate2,P,R)">selectWith</a>, <a href="../RichIterable.html#size()">size</a>, <a href="../RichIterable.html#sumByDouble(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.primitive.DoubleFunction)">sumByDouble</a>, <a href="../RichIterable.html#sumByFloat(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.primitive.FloatFunction)">sumByFloat</a>, <a href="../RichIterable.html#sumByInt(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.primitive.IntFunction)">sumByInt</a>, <a href="../RichIterable.html#sumByLong(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.primitive.LongFunction)">sumByLong</a>, <a href="../RichIterable.html#sumOfDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">sumOfDouble</a>, <a href="../RichIterable.html#sumOfFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">sumOfFloat</a>, <a href="../RichIterable.html#sumOfInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">sumOfInt</a>, <a href="../RichIterable.html#sumOfLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">sumOfLong</a>, <a href="../RichIterable.html#toArray()">toArray</a>, <a href="../RichIterable.html#toArray(E%5B%5D)">toArray</a>, <a href="../RichIterable.html#toBag()">toBag</a>, <a href="../RichIterable.html#toBiMap(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function)">toBiMap</a>, <a href="../RichIterable.html#toList()">toList</a>, <a href="../RichIterable.html#toMap(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function)">toMap</a>, <a href="../RichIterable.html#toMap(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function,R)">toMap</a>, <a href="../RichIterable.html#toSet()">toSet</a>, <a href="../RichIterable.html#toSortedBag()">toSortedBag</a>, <a href="../RichIterable.html#toSortedBag(java.util.Comparator)">toSortedBag</a>, <a href="../RichIterable.html#toSortedBagBy(org.eclipse.collections.api.block.function.Function)">toSortedBagBy</a>, <a href="../RichIterable.html#toSortedList()">toSortedList</a>, <a href="../RichIterable.html#toSortedList(java.util.Comparator)">toSortedList</a>, <a href="../RichIterable.html#toSortedListBy(org.eclipse.collections.api.block.function.Function)">toSortedListBy</a>, <a href="../RichIterable.html#toSortedMap(java.util.Comparator,org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function)">toSortedMap</a>, <a href="../RichIterable.html#toSortedMap(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function)">toSortedMap</a>, <a href="../RichIterable.html#toSortedMapBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function)">toSortedMapBy</a>, <a href="../RichIterable.html#toSortedSet()">toSortedSet</a>, <a href="../RichIterable.html#toSortedSet(java.util.Comparator)">toSortedSet</a>, <a href="../RichIterable.html#toSortedSetBy(org.eclipse.collections.api.block.function.Function)">toSortedSetBy</a>, <a href="../RichIterable.html#toString()">toString</a>, <a href="../RichIterable.html#zip(java.lang.Iterable)">zip</a>, <a href="../RichIterable.html#zip(java.lang.Iterable,R)">zip</a>, <a href="../RichIterable.html#zipWithIndex(R)">zipWithIndex</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li class="blockList"> |
| <section class="methodDetails"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h2>Method Details</h2> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="equals(java.lang.Object)">equals</a></h3> |
| <div class="memberSignature"><span class="returnType">boolean</span> <span class="memberName">equals</span>​(<span class="arguments"><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> object)</span></div> |
| <div class="block">Two bags <code>b1</code> and <code>b2</code> are equal if <code>m1.toMapOfItemToCount().equals(m2.toMapOfItemToCount())</code>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><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></code> in class <code><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></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.util" class="externalLink"><code>Map.equals(Object)</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="hashCode()">hashCode</a></h3> |
| <div class="memberSignature"><span class="returnType">int</span> <span class="memberName">hashCode</span>()</div> |
| <div class="block">Returns the hash code for this Bag, defined as <em>this.<a href="#toMapOfItemToCount()"><code>toMapOfItemToCount()</code></a>.hashCode()</em>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><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></code> in class <code><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></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true#hashCode()" title="class or interface in java.util" class="externalLink"><code>Map.hashCode()</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="tap(org.eclipse.collections.api.block.procedure.Procedure)">tap</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">tap</span>​(<span class="arguments"><a href="../block/procedure/Procedure.html" title="interface in org.eclipse.collections.api.block.procedure">Procedure</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> procedure)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#tap(org.eclipse.collections.api.block.procedure.Procedure)">RichIterable</a></code></span></div> |
| <div class="block">Executes the Procedure for each element in the iterable and returns <code>this</code>. |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| RichIterable<Person> tapped = |
| people.<b>tap</b>(person -> LOGGER.info(person.getName())); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| RichIterable<Person> tapped = |
| people.<b>tap</b>(new Procedure<Person>() |
| { |
| public void value(Person person) |
| { |
| LOGGER.info(person.getName()); |
| } |
| }); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#tap(org.eclipse.collections.api.block.procedure.Procedure)">tap</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../RichIterable.html#each(org.eclipse.collections.api.block.procedure.Procedure)"><code>RichIterable.each(Procedure)</code></a>, |
| <a href="../RichIterable.html#forEach(org.eclipse.collections.api.block.procedure.Procedure)"><code>RichIterable.forEach(Procedure)</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="select(org.eclipse.collections.api.block.predicate.Predicate)">select</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">select</span>​(<span class="arguments"><a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)">RichIterable</a></code></span></div> |
| <div class="block">Returns all elements of the source collection that return true when evaluating the predicate. This method is also |
| commonly called filter. |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| RichIterable<Person> selected = |
| people.<b>select</b>(person -> person.getAddress().getCity().equals("London")); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| RichIterable<Person> selected = |
| people.<b>select</b>(new Predicate<Person>() |
| { |
| public boolean accept(Person person) |
| { |
| return person.getAddress().getCity().equals("London"); |
| } |
| }); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)">select</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="selectWith(org.eclipse.collections.api.block.predicate.Predicate2,java.lang.Object)"> |
| <!-- --> |
| </a><a id="selectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">selectWith</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><P></span> <span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">selectWith</span>​(<span class="arguments"><a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#selectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">RichIterable</a></code></span></div> |
| <div class="block">Similar to <a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.select(Predicate)</code></a>, except with an evaluation parameter for the second generic argument in <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a>. |
| <p> |
| E.g. return a <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> of Person elements where the person has an age <b>greater than or equal to</b> 18 years |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| RichIterable<Person> selected = |
| people.selectWith((Person person, Integer age) -> person.getAge()>= age, Integer.valueOf(18)); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| RichIterable<Person> selected = |
| people.selectWith(new Predicate2<Person, Integer>() |
| { |
| public boolean accept(Person person, Integer age) |
| { |
| return person.getAge()>= age; |
| } |
| }, Integer.valueOf(18)); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#selectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">selectWith</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>predicate</code> - a <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a> to use as the select criteria</dd> |
| <dd><code>parameter</code> - a parameter to pass in for evaluation of the second argument <code>P</code> in <code>predicate</code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.select(Predicate)</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="reject(org.eclipse.collections.api.block.predicate.Predicate)">reject</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">reject</span>​(<span class="arguments"><a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#reject(org.eclipse.collections.api.block.predicate.Predicate)">RichIterable</a></code></span></div> |
| <div class="block">Returns all elements of the source collection that return false when evaluating of the predicate. This method is also |
| sometimes called filterNot and is the equivalent of calling iterable.select(Predicates.not(predicate)). |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| RichIterable<Person> rejected = |
| people.reject(person -> person.person.getLastName().equals("Smith")); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| RichIterable<Person> rejected = |
| people.reject(new Predicate<Person>() |
| { |
| public boolean accept(Person person) |
| { |
| return person.person.getLastName().equals("Smith"); |
| } |
| }); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#reject(org.eclipse.collections.api.block.predicate.Predicate)">reject</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>predicate</code> - a <a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate</code></a> to use as the reject criteria</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a RichIterable that contains elements that cause <a href="../block/predicate/Predicate.html#accept(T)"><code>Predicate.accept(Object)</code></a> method to evaluate to false</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,java.lang.Object)"> |
| <!-- --> |
| </a><a id="rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">rejectWith</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><P></span> <span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">rejectWith</span>​(<span class="arguments"><a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">RichIterable</a></code></span></div> |
| <div class="block">Similar to <a href="../RichIterable.html#reject(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.reject(Predicate)</code></a>, except with an evaluation parameter for the second generic argument in <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a>. |
| <p> |
| E.g. return a <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> of Person elements where the person has an age <b>greater than or equal to</b> 18 years |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| RichIterable<Person> rejected = |
| people.rejectWith((Person person, Integer age) -> person.getAge() < age, Integer.valueOf(18)); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| MutableList<Person> rejected = |
| people.rejectWith(new Predicate2<Person, Integer>() |
| { |
| public boolean accept(Person person, Integer age) |
| { |
| return person.getAge() < age; |
| } |
| }, Integer.valueOf(18)); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#rejectWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">rejectWith</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>predicate</code> - a <a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate"><code>Predicate2</code></a> to use as the select criteria</dd> |
| <dd><code>parameter</code> - a parameter to pass in for evaluation of the second argument <code>P</code> in <code>predicate</code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../RichIterable.html#select(org.eclipse.collections.api.block.predicate.Predicate)"><code>RichIterable.select(Predicate)</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="partition(org.eclipse.collections.api.block.predicate.Predicate)">partition</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../partition/bag/PartitionBag.html" title="interface in org.eclipse.collections.api.partition.bag">PartitionBag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">partition</span>​(<span class="arguments"><a href="../block/predicate/Predicate.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> predicate)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#partition(org.eclipse.collections.api.block.predicate.Predicate)">RichIterable</a></code></span></div> |
| <div class="block">Filters a collection into a PartitionedIterable based on the evaluation of the predicate. |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| PartitionIterable<Person> newYorkersAndNonNewYorkers = |
| people.<b>partition</b>(person -> person.getAddress().getState().getName().equals("New York")); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| PartitionIterable<Person> newYorkersAndNonNewYorkers = |
| people.<b>partition</b>(new Predicate<Person>() |
| { |
| public boolean accept(Person person) |
| { |
| return person.getAddress().getState().getName().equals("New York"); |
| } |
| }); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#partition(org.eclipse.collections.api.block.predicate.Predicate)">partition</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="partitionWith(org.eclipse.collections.api.block.predicate.Predicate2,java.lang.Object)"> |
| <!-- --> |
| </a><a id="partitionWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">partitionWith</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><P></span> <span class="returnType"><a href="../partition/bag/PartitionBag.html" title="interface in org.eclipse.collections.api.partition.bag">PartitionBag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">partitionWith</span>​(<span class="arguments"><a href="../block/predicate/Predicate2.html" title="interface in org.eclipse.collections.api.block.predicate">Predicate2</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? super P> predicate, |
| P parameter)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#partitionWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">RichIterable</a></code></span></div> |
| <div class="block">Filters a collection into a PartitionIterable based on the evaluation of the predicate. |
| <p> |
| Example using a Java 8 lambda expression: |
| <pre> |
| PartitionIterable<Person> newYorkersAndNonNewYorkers = |
| people.<b>partitionWith</b>((Person person, String state) -> person.getAddress().getState().getName().equals(state), "New York"); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| PartitionIterable<Person> newYorkersAndNonNewYorkers = |
| people.<b>partitionWith</b>(new Predicate2<Person, String>() |
| { |
| public boolean accept(Person person, String state) |
| { |
| return person.getAddress().getState().getName().equals(state); |
| } |
| }, "New York"); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#partitionWith(org.eclipse.collections.api.block.predicate.Predicate2,P)">partitionWith</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="selectInstancesOf(java.lang.Class)">selectInstancesOf</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><S></span> <span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><S></span> <span class="memberName">selectInstancesOf</span>​(<span class="arguments"><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><S> clazz)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#selectInstancesOf(java.lang.Class)">RichIterable</a></code></span></div> |
| <div class="block">Returns all elements of the source collection that are instances of the Class <code>clazz</code>. |
| |
| <pre> |
| RichIterable<Integer> integers = |
| List.mutable.with(new Integer(0), new Long(0L), new Double(0.0)).selectInstancesOf(Integer.class); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#selectInstancesOf(java.lang.Class)">selectInstancesOf</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="groupBy(org.eclipse.collections.api.block.function.Function)">groupBy</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><V></span> <span class="returnType"><a href="../multimap/bag/BagMultimap.html" title="interface in org.eclipse.collections.api.multimap.bag">BagMultimap</a><V,​<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">groupBy</span>​(<span class="arguments"><a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#groupBy(org.eclipse.collections.api.block.function.Function)">RichIterable</a></code></span></div> |
| <div class="block">For each element of the iterable, the function is evaluated and the results of these evaluations are collected |
| into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) |
| species of collection as the source iterable. |
| <p> |
| Example using a Java 8 method reference: |
| <pre> |
| Multimap<String, Person> peopleByLastName = |
| people.groupBy(Person::getLastName); |
| </pre> |
| <p> |
| Example using an anonymous inner class: |
| <pre> |
| Multimap<String, Person> peopleByLastName = |
| people.groupBy(new Function<Person, String>() |
| { |
| public String valueOf(Person person) |
| { |
| return person.getLastName(); |
| } |
| }); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#groupBy(org.eclipse.collections.api.block.function.Function)">groupBy</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="groupByEach(org.eclipse.collections.api.block.function.Function)">groupByEach</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><V></span> <span class="returnType"><a href="../multimap/bag/BagMultimap.html" title="interface in org.eclipse.collections.api.multimap.bag">BagMultimap</a><V,​<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">groupByEach</span>​(<span class="arguments"><a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang" class="externalLink">Iterable</a><V>> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#groupByEach(org.eclipse.collections.api.block.function.Function)">RichIterable</a></code></span></div> |
| <div class="block">Similar to <a href="../RichIterable.html#groupBy(org.eclipse.collections.api.block.function.Function)"><code>RichIterable.groupBy(Function)</code></a>, except the result of evaluating function will return a collection of keys |
| for each value.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#groupByEach(org.eclipse.collections.api.block.function.Function)">groupByEach</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="zipWithIndex()">zipWithIndex</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../set/SetIterable.html" title="interface in org.eclipse.collections.api.set">SetIterable</a><<a href="../tuple/Pair.html" title="interface in org.eclipse.collections.api.tuple">Pair</a><<a href="Bag.html" title="type parameter in Bag">T</a>,​<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink">Integer</a>>></span> <span class="memberName">zipWithIndex</span>()</div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#zipWithIndex()">RichIterable</a></code></span></div> |
| <div class="block">Zips this <code>RichIterable</code> with its indices.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#zipWithIndex()">zipWithIndex</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A new <code>RichIterable</code> containing pairs consisting of all elements of this <code>RichIterable</code> |
| paired with their index. Indices start at 0.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../RichIterable.html#zip(java.lang.Iterable)"><code>RichIterable.zip(Iterable)</code></a></dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="forEachWithOccurrences(org.eclipse.collections.api.block.procedure.primitive.ObjectIntProcedure)">forEachWithOccurrences</a></h3> |
| <div class="memberSignature"><span class="returnType">void</span> <span class="memberName">forEachWithOccurrences</span>​(<span class="arguments"><a href="../block/procedure/primitive/ObjectIntProcedure.html" title="interface in org.eclipse.collections.api.block.procedure.primitive">ObjectIntProcedure</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> procedure)</span></div> |
| <div class="block">For each distinct item, with the number of occurrences, execute the specified procedure.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="occurrencesOf(java.lang.Object)">occurrencesOf</a></h3> |
| <div class="memberSignature"><span class="returnType">int</span> <span class="memberName">occurrencesOf</span>​(<span class="arguments"><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> item)</span></div> |
| <div class="block">The occurrences of a distinct item in the bag.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="selectByOccurrences(org.eclipse.collections.api.block.predicate.primitive.IntPredicate)">selectByOccurrences</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">selectByOccurrences</span>​(<span class="arguments"><a href="../block/predicate/primitive/IntPredicate.html" title="interface in org.eclipse.collections.api.block.predicate.primitive">IntPredicate</a> predicate)</span></div> |
| <div class="block">Returns all elements of the bag that have a number of occurrences that satisfy the predicate.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>3.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="selectDuplicates()">selectDuplicates</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="returnType"><a href="Bag.html" title="interface in org.eclipse.collections.api.bag">Bag</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">selectDuplicates</span>()</div> |
| <div class="block">Returns all elements of the bag that have more than one occurrence.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>9.2</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="selectUnique()">selectUnique</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../set/SetIterable.html" title="interface in org.eclipse.collections.api.set">SetIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">selectUnique</span>()</div> |
| <div class="block">Returns a set containing all elements of the bag that have exactly one occurrence.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>9.2</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="topOccurrences(int)">topOccurrences</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../list/ListIterable.html" title="interface in org.eclipse.collections.api.list">ListIterable</a><<a href="../tuple/primitive/ObjectIntPair.html" title="interface in org.eclipse.collections.api.tuple.primitive">ObjectIntPair</a><<a href="Bag.html" title="type parameter in Bag">T</a>>></span> <span class="memberName">topOccurrences</span>​(<span class="arguments">int count)</span></div> |
| <div class="block">Returns the <code>count</code> most frequently occurring items. |
| |
| In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last |
| item will be returned.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>6.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="bottomOccurrences(int)">bottomOccurrences</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../list/ListIterable.html" title="interface in org.eclipse.collections.api.list">ListIterable</a><<a href="../tuple/primitive/ObjectIntPair.html" title="interface in org.eclipse.collections.api.tuple.primitive">ObjectIntPair</a><<a href="Bag.html" title="type parameter in Bag">T</a>>></span> <span class="memberName">bottomOccurrences</span>​(<span class="arguments">int count)</span></div> |
| <div class="block">Returns the <code>count</code> least frequently occurring items. |
| |
| In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last |
| item will be returned.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>6.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="sizeDistinct()">sizeDistinct</a></h3> |
| <div class="memberSignature"><span class="returnType">int</span> <span class="memberName">sizeDistinct</span>()</div> |
| <div class="block">The size of the Bag when counting only distinct elements.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="toMapOfItemToCount()">toMapOfItemToCount</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="../map/MapIterable.html" title="interface in org.eclipse.collections.api.map">MapIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>,​<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang" class="externalLink">Integer</a>></span> <span class="memberName">toMapOfItemToCount</span>()</div> |
| <div class="block">Converts the Bag to a Map of the Item type to its count as an Integer.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="toStringOfItemToCount()">toStringOfItemToCount</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></span> <span class="memberName">toStringOfItemToCount</span>()</div> |
| <div class="block">Returns a string representation of this bag. The string representation consists of a list of element-count mappings. |
| |
| <pre> |
| Assert.assertEquals("{1=1, 2=2, 3=3}", Bags.mutable.with(1, 2, 2, 3, 3, 3).toStringOfItemToCount()); |
| </pre> |
| This string representation is similar to <a href="https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html?is-external=true#toString()" title="class or interface in java.util" class="externalLink"><code>AbstractMap.toString()</code></a>, not <a href="../RichIterable.html#toString()"><code>RichIterable.toString()</code></a>, |
| whereas the <code>toString()</code> implementation for a Bag is consistent with <a href="../RichIterable.html#toString()"><code>RichIterable.toString()</code></a>.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a string representation of this bag</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>3.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="toImmutable()">toImmutable</a></h3> |
| <div class="memberSignature"><span class="returnType"><a href="ImmutableBagIterable.html" title="interface in org.eclipse.collections.api.bag">ImmutableBagIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></span> <span class="memberName">toImmutable</span>()</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="summarizeInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">summarizeInt</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="returnType"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/IntSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">IntSummaryStatistics</a></span> <span class="memberName">summarizeInt</span>​(<span class="arguments"><a href="../block/function/primitive/IntFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">IntFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#summarizeInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">RichIterable</a></code></span></div> |
| <div class="block">Returns the result of summarizing the value returned from applying the IntFunction to |
| each element of the iterable. |
| |
| <pre> |
| IntSummaryStatistics stats = |
| Lists.mutable.with(1, 2, 3).summarizeInt(Integer::intValue); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#summarizeInt(org.eclipse.collections.api.block.function.primitive.IntFunction)">summarizeInt</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="summarizeFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">summarizeFloat</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="returnType"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/DoubleSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">DoubleSummaryStatistics</a></span> <span class="memberName">summarizeFloat</span>​(<span class="arguments"><a href="../block/function/primitive/FloatFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">FloatFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#summarizeFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">RichIterable</a></code></span></div> |
| <div class="block">Returns the result of summarizing the value returned from applying the FloatFunction to |
| each element of the iterable. |
| |
| <pre> |
| DoubleSummaryStatistics stats = |
| Lists.mutable.with(1, 2, 3).summarizeFloat(Integer::floatValue); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#summarizeFloat(org.eclipse.collections.api.block.function.primitive.FloatFunction)">summarizeFloat</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="summarizeLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">summarizeLong</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="returnType"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/LongSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">LongSummaryStatistics</a></span> <span class="memberName">summarizeLong</span>​(<span class="arguments"><a href="../block/function/primitive/LongFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">LongFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#summarizeLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">RichIterable</a></code></span></div> |
| <div class="block">Returns the result of summarizing the value returned from applying the LongFunction to |
| each element of the iterable. |
| |
| <pre> |
| LongSummaryStatistics stats = |
| Lists.mutable.with(1, 2, 3).summarizeLong(Integer::longValue); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#summarizeLong(org.eclipse.collections.api.block.function.primitive.LongFunction)">summarizeLong</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="summarizeDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">summarizeDouble</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="returnType"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/DoubleSummaryStatistics.html?is-external=true" title="class or interface in java.util" class="externalLink">DoubleSummaryStatistics</a></span> <span class="memberName">summarizeDouble</span>​(<span class="arguments"><a href="../block/function/primitive/DoubleFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">DoubleFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>> function)</span></div> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../RichIterable.html#summarizeDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">RichIterable</a></code></span></div> |
| <div class="block">Returns the result of summarizing the value returned from applying the DoubleFunction to |
| each element of the iterable. |
| |
| <pre> |
| DoubleSummaryStatistics stats = |
| Lists.mutable.with(1, 2, 3).summarizeDouble(Integer::doubleValue); |
| </pre></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#summarizeDouble(org.eclipse.collections.api.block.function.primitive.DoubleFunction)">summarizeDouble</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="reduceInPlace(java.util.stream.Collector)">reduceInPlace</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="typeParameters"><R,​ |
| A></span> <span class="returnType">R</span> <span class="memberName">reduceInPlace</span>​(<span class="arguments"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collector.html?is-external=true" title="class or interface in java.util.stream" class="externalLink">Collector</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​A,​R> collector)</span></div> |
| <div class="block">This method produces the equivalent result as <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true#collect(java.util.stream.Collector)" title="class or interface in java.util.stream" class="externalLink"><code>Stream.collect(Collector)</code></a>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#reduceInPlace(java.util.stream.Collector)">reduceInPlace</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="reduceInPlace(java.util.function.Supplier,java.util.function.BiConsumer)">reduceInPlace</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="typeParameters"><R></span> <span class="returnType">R</span> <span class="memberName">reduceInPlace</span>​(<span class="arguments"><a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Supplier</a><R> supplier, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html?is-external=true" title="class or interface in java.util.function" class="externalLink">BiConsumer</a><R,​? super <a href="Bag.html" title="type parameter in Bag">T</a>> accumulator)</span></div> |
| <div class="block">This method produces the equivalent result as <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html?is-external=true#collect(java.util.function.Supplier,java.util.function.BiConsumer,java.util.function.BiConsumer)" title="class or interface in java.util.stream" class="externalLink"><code>Stream.collect(Supplier, BiConsumer, BiConsumer)</code></a>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#reduceInPlace(java.util.function.Supplier,java.util.function.BiConsumer)">reduceInPlace</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>8.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="collectWithOccurrences(org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction)">collectWithOccurrences</a></h3> |
| <div class="memberSignature"><span class="typeParameters"><V></span> <span class="returnType"><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><V></span> <span class="memberName">collectWithOccurrences</span>​(<span class="arguments"><a href="../block/function/primitive/ObjectIntToObjectFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">ObjectIntToObjectFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function)</span></div> |
| <div class="block">Iterates over the unique elements and their occurrences and collects the results of applying the specified function.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>10.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="collectWithOccurrences(org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction,java.util.Collection)"> |
| <!-- --> |
| </a><a id="collectWithOccurrences(org.eclipse.collections.api.block.function.primitive.ObjectIntToObjectFunction,R)">collectWithOccurrences</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="typeParameters"><V,​ |
| R extends <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><V>></span> <span class="returnType">R</span> <span class="memberName">collectWithOccurrences</span>​(<span class="arguments"><a href="../block/function/primitive/ObjectIntToObjectFunction.html" title="interface in org.eclipse.collections.api.block.function.primitive">ObjectIntToObjectFunction</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> function, |
| R target)</span></div> |
| <div class="block">Iterates over the unique elements and their occurrences and collects the results of applying the |
| specified function into the target collection.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>9.1.</dd> |
| </dl> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="aggregateBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.function.Function2,org.eclipse.collections.api.map.MutableMapIterable)"> |
| <!-- --> |
| </a><a id="aggregateBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.function.Function2,R)">aggregateBy</a></h3> |
| <div class="memberSignature"><span class="modifiers">default</span> <span class="typeParameters"><K,​ |
| V,​ |
| R extends <a href="../map/MutableMapIterable.html" title="interface in org.eclipse.collections.api.map">MutableMapIterable</a><K,​ |
| V>></span> <span class="returnType">R</span> <span class="memberName">aggregateBy</span>​(<span class="arguments"><a href="../block/function/Function.html" title="interface in org.eclipse.collections.api.block.function">Function</a><? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends K> groupBy, |
| <a href="../block/function/Function0.html" title="interface in org.eclipse.collections.api.block.function">Function0</a><? extends V> zeroValueFactory, |
| <a href="../block/function/Function2.html" title="interface in org.eclipse.collections.api.block.function">Function2</a><? super V,​? super <a href="Bag.html" title="type parameter in Bag">T</a>,​? extends V> nonMutatingAggregator, |
| R target)</span></div> |
| <div class="block">Applies an aggregate function over the iterable grouping results into the target map based on the specific |
| groupBy function. Aggregate results are allowed to be immutable as they will be replaced in place in the map. A |
| second function specifies the initial "zero" aggregate value to work with (i.e. Integer.valueOf(0)). |
| |
| This method is overridden and optimized for Bag to use forEachWithOccurrences instead of forEach.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../RichIterable.html#aggregateBy(org.eclipse.collections.api.block.function.Function,org.eclipse.collections.api.block.function.Function0,org.eclipse.collections.api.block.function.Function2,R)">aggregateBy</a></code> in interface <code><a href="../RichIterable.html" title="interface in org.eclipse.collections.api">RichIterable</a><<a href="Bag.html" title="type parameter in Bag">T</a>></code></dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>10.3</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <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/Bag.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"> |
| <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> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2004–2020. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |