| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>ReservoirLongsSketch (datasketches-java 4.0.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.min.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="ReservoirLongsSketch (datasketches-java 4.0.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":9,"i8":10,"i9":10,"i10":10,"i11":9,"i12":9,"i13":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/ReservoirLongsSketch.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.datasketches.sampling</a></div> |
| <h2 title="Class ReservoirLongsSketch" class="title">Class ReservoirLongsSketch</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.datasketches.sampling.ReservoirLongsSketch</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre>public final class <span class="typeNameLabel">ReservoirLongsSketch</span> |
| extends <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></pre> |
| <div class="block">This sketch provides a reservoir sample over an input stream of <code>long</code>s. The sketch |
| contains a uniform random sample of items from the stream.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Jon Malkin, Kevin Lang</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code><a href="SampleSubsetSummary.html" title="class in org.apache.datasketches.sampling">SampleSubsetSummary</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#estimateSubsetSum(java.util.function.Predicate)">estimateSubsetSum</a></span>​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Predicate</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>> predicate)</code></th> |
| <td class="colLast"> |
| <div class="block">Computes an estimated subset sum from the entire stream for objects matching a given |
| predicate.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getK()">getK</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the sketch's value of <i>k</i>, the maximum number of samples stored in the reservoir.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getN()">getN</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of items processed from the input stream</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNumSamples()">getNumSamples</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the current number of items in the reservoir, which may be smaller than the reservoir |
| capacity.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>long[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSamples()">getSamples</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a copy of the items in the reservoir.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#heapify(org.apache.datasketches.memory.Memory)">heapify</a></span>​(org.apache.datasketches.memory.Memory srcMem)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a sketch instance of this class from the given srcMem, which must be a Memory |
| representation of this sketch class.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newInstance(int)">newInstance</a></span>​(int k)</code></th> |
| <td class="colLast"> |
| <div class="block">Construct a mergeable reservoir sampling sketch with up to k samples using the default resize |
| factor (8).</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#newInstance(int,org.apache.datasketches.common.ResizeFactor)">newInstance</a></span>​(int k, |
| <a href="../common/ResizeFactor.html" title="enum in org.apache.datasketches.common">ResizeFactor</a> rf)</code></th> |
| <td class="colLast"> |
| <div class="block">Construct a mergeable reservoir sampling sketch with up to k samples using the default resize |
| factor (8).</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#reset()">reset</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Resets this sketch to the empty state, but retains the original value of k.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>byte[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toByteArray()">toByteArray</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a byte array representation of this sketch</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <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="#toString()">toString</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a human-readable summary of the sketch, without items.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>static <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="#toString(byte%5B%5D)">toString</a></span>​(byte[] byteArr)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>static <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="#toString(org.apache.datasketches.memory.Memory)">toString</a></span>​(org.apache.datasketches.memory.Memory mem)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(long)">update</a></span>​(long item)</code></th> |
| <td class="colLast"> |
| <div class="block">Randomly decide whether or not to include an item in the sample set.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="newInstance(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newInstance</h4> |
| <pre class="methodSignature">public static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a> newInstance​(int k)</pre> |
| <div class="block">Construct a mergeable reservoir sampling sketch with up to k samples using the default resize |
| factor (8).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>k</code> - Maximum size of sampling. Allocated size may be smaller until sampling fills. Unlike |
| many sketches in this package, this value does <em>not</em> need to be a power of 2.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A ReservoirLongsSketch initialized with maximum size k and the default resize factor.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="newInstance(int,org.apache.datasketches.common.ResizeFactor)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>newInstance</h4> |
| <pre class="methodSignature">public static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a> newInstance​(int k, |
| <a href="../common/ResizeFactor.html" title="enum in org.apache.datasketches.common">ResizeFactor</a> rf)</pre> |
| <div class="block">Construct a mergeable reservoir sampling sketch with up to k samples using the default resize |
| factor (8).</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>k</code> - Maximum size of sampling. Allocated size may be smaller until sampling fills. Unlike |
| many sketches in this package, this value does <em>not</em> need to be a power of 2.</dd> |
| <dd><code>rf</code> - <a href="../../../../resources/dictionary.html#resizeFactor">See Resize Factor</a></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A ReservoirLongsSketch initialized with maximum size k and ResizeFactor rf.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="heapify(org.apache.datasketches.memory.Memory)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>heapify</h4> |
| <pre class="methodSignature">public static <a href="ReservoirLongsSketch.html" title="class in org.apache.datasketches.sampling">ReservoirLongsSketch</a> heapify​(org.apache.datasketches.memory.Memory srcMem)</pre> |
| <div class="block">Returns a sketch instance of this class from the given srcMem, which must be a Memory |
| representation of this sketch class.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>srcMem</code> - a Memory representation of a sketch of this class. <a href="../../../../resources/dictionary.html#mem">See Memory</a></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a sketch instance of this class</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getK()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getK</h4> |
| <pre class="methodSignature">public int getK()</pre> |
| <div class="block">Returns the sketch's value of <i>k</i>, the maximum number of samples stored in the reservoir. |
| The current number of items in the sketch may be lower.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>k, the maximum number of samples in the reservoir</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getN()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getN</h4> |
| <pre class="methodSignature">public long getN()</pre> |
| <div class="block">Returns the number of items processed from the input stream</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>n, the number of stream items the sketch has seen</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getNumSamples()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getNumSamples</h4> |
| <pre class="methodSignature">public int getNumSamples()</pre> |
| <div class="block">Returns the current number of items in the reservoir, which may be smaller than the reservoir |
| capacity.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the number of items currently in the reservoir</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="getSamples()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSamples</h4> |
| <pre class="methodSignature">public long[] getSamples()</pre> |
| <div class="block">Returns a copy of the items in the reservoir. The returned array length may be smaller than the |
| reservoir capacity.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A copy of the reservoir array</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="update(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>update</h4> |
| <pre class="methodSignature">public void update​(long item)</pre> |
| <div class="block">Randomly decide whether or not to include an item in the sample set.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>item</code> - a unit-weight (equivalently, unweighted) item of the set being sampled from</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="reset()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>reset</h4> |
| <pre class="methodSignature">public void reset()</pre> |
| <div class="block">Resets this sketch to the empty state, but retains the original value of k.</div> |
| </li> |
| </ul> |
| <a id="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public <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> toString()</pre> |
| <div class="block">Returns a human-readable summary of the sketch, without items.</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#toString()" title="class or interface in java.lang" class="externalLink">toString</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="returnLabel">Returns:</span></dt> |
| <dd>A string version of the sketch summary</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString(byte[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static <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> toString​(byte[] byteArr)</pre> |
| <div class="block">Returns a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>byteArr</code> - the given byte array</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a human readable string of the preamble of a byte array image of a ReservoirLongsSketch.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toString(org.apache.datasketches.memory.Memory)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public static <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> toString​(org.apache.datasketches.memory.Memory mem)</pre> |
| <div class="block">Returns a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>mem</code> - the given Memory</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a human readable string of the preamble of a Memory image of a ReservoirLongsSketch.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="toByteArray()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>toByteArray</h4> |
| <pre class="methodSignature">public byte[] toByteArray()</pre> |
| <div class="block">Returns a byte array representation of this sketch</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a byte array representation of this sketch</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="estimateSubsetSum(java.util.function.Predicate)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>estimateSubsetSum</h4> |
| <pre class="methodSignature">public <a href="SampleSubsetSummary.html" title="class in org.apache.datasketches.sampling">SampleSubsetSummary</a> estimateSubsetSum​(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html?is-external=true" title="class or interface in java.util.function" class="externalLink">Predicate</a><<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>> predicate)</pre> |
| <div class="block">Computes an estimated subset sum from the entire stream for objects matching a given |
| predicate. Provides a lower bound, estimate, and upper bound using a target of 2 standard |
| deviations. |
| |
| <p>This is technically a heuristic method, and tries to err on the conservative side.</p></div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>predicate</code> - A predicate to use when identifying items.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>A summary object containing the estimate, upper and lower bounds, and the total |
| sketch weight.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/ReservoirLongsSketch.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2015–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </body> |
| </html> |