blob: 1632978e16062aa3bad9b647d1a8d8f25193357f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Thu Mar 14 13:13:09 PDT 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>UpdateSketch (com.yahoo.datasketches:sketches-core 0.13.1-SNAPSHOT API)</title>
<meta name="date" content="2019-03-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="UpdateSketch (com.yahoo.datasketches:sketches-core 0.13.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":10,"i2":10,"i3":6,"i4":6,"i5":9,"i6":9,"i7":10,"i8":10,"i9":6,"i10":6,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":9,"i19":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UpdateSketch.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">
<li><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../com/yahoo/sketches/theta/UpdateSketchBuilder.html" title="class in com.yahoo.sketches.theta"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/theta/UpdateSketch.html" target="_top">Frames</a></li>
<li><a href="UpdateSketch.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.yahoo.sketches.theta</div>
<h2 title="Class UpdateSketch" class="title">Class UpdateSketch</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">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">com.yahoo.sketches.theta.Sketch</a></li>
<li>
<ul class="inheritance">
<li>com.yahoo.sketches.theta.UpdateSketch</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">UpdateSketch</span>
extends <a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></pre>
<div class="block">The parent class for the Update Sketch families, such as QuickSelect and Alpha.
The primary task of an Update Sketch is to consider datums presented via the update() methods
for inclusion in its internal cache. This is the sketch building process.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Lee Rhodes</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/theta/UpdateSketchBuilder.html" title="class in com.yahoo.sketches.theta">UpdateSketchBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#builder--">builder</a></span>()</code>
<div class="block">Returns a new builder</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/CompactSketch.html" title="class in com.yahoo.sketches.theta">CompactSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#compact--">compact</a></span>()</code>
<div class="block">Converts this sketch to an ordered CompactSketch on the Java heap.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/CompactSketch.html" title="class in com.yahoo.sketches.theta">CompactSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#compact-boolean-com.yahoo.memory.WritableMemory-">compact</a></span>(boolean&nbsp;dstOrdered,
com.yahoo.memory.WritableMemory&nbsp;dstMem)</code>
<div class="block">Convert this sketch to a CompactSketch in the chosen form.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#getLgNomLongs--">getLgNomLongs</a></span>()</code>
<div class="block">Gets the Log base 2 of the configured nominal entries</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../com/yahoo/sketches/ResizeFactor.html" title="enum in com.yahoo.sketches">ResizeFactor</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#getResizeFactor--">getResizeFactor</a></span>()</code>
<div class="block">Returns the configured ResizeFactor</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#heapify-com.yahoo.memory.Memory-">heapify</a></span>(com.yahoo.memory.Memory&nbsp;srcMem)</code>
<div class="block">Instantiates an on-heap UpdateSketch from Memory.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#heapify-com.yahoo.memory.Memory-long-">heapify</a></span>(com.yahoo.memory.Memory&nbsp;srcMem,
long&nbsp;seed)</code>
<div class="block">Instantiates an on-heap UpdateSketch from Memory.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#isCompact--">isCompact</a></span>()</code>
<div class="block">Returns true if this sketch is in compact form.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#isOrdered--">isOrdered</a></span>()</code>
<div class="block">Returns true if internal cache is ordered</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#rebuild--">rebuild</a></span>()</code>
<div class="block">Rebuilds the hash table to remove dirty values or to reduce the size
to nominal entries.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#reset--">reset</a></span>()</code>
<div class="block">Resets this sketch back to a virgin empty state.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-byte:A-">update</a></span>(byte[]&nbsp;data)</code>
<div class="block">Present this sketch with the given byte array.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-char:A-">update</a></span>(char[]&nbsp;data)</code>
<div class="block">Present this sketch with the given char array.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-double-">update</a></span>(double&nbsp;datum)</code>
<div class="block">Present this sketch with the given double (or float) datum.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-int:A-">update</a></span>(int[]&nbsp;data)</code>
<div class="block">Present this sketch with the given integer array.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-long-">update</a></span>(long&nbsp;datum)</code>
<div class="block">Present this sketch with a long.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-long:A-">update</a></span>(long[]&nbsp;data)</code>
<div class="block">Present this sketch with the given long array.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-java.lang.String-">update</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;datum)</code>
<div class="block">Present this sketch with the given String.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#wrap-com.yahoo.memory.WritableMemory-">wrap</a></span>(com.yahoo.memory.WritableMemory&nbsp;srcMem)</code>
<div class="block">Wrap takes the sketch image in Memory and refers to it directly.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#wrap-com.yahoo.memory.WritableMemory-long-">wrap</a></span>(com.yahoo.memory.WritableMemory&nbsp;srcMem,
long&nbsp;seed)</code>
<div class="block">Wrap takes the sketch image in Memory and refers to it directly.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.com.yahoo.sketches.theta.Sketch">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;com.yahoo.sketches.theta.<a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></h3>
<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#getCountLessThanTheta-double-">getCountLessThanTheta</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getCurrentBytes-boolean-">getCurrentBytes</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getEstimate--">getEstimate</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getFamily--">getFamily</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getLowerBound-int-">getLowerBound</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getMaxCompactSketchBytes-int-">getMaxCompactSketchBytes</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getMaxUpdateSketchBytes-int-">getMaxUpdateSketchBytes</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getRetainedEntries--">getRetainedEntries</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getRetainedEntries-boolean-">getRetainedEntries</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getSerializationVersion-com.yahoo.memory.Memory-">getSerializationVersion</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getTheta--">getTheta</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getThetaLong--">getThetaLong</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#getUpperBound-int-">getUpperBound</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#hasMemory--">hasMemory</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#isDirect--">isDirect</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#isEmpty--">isEmpty</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#isEstimationMode--">isEstimationMode</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#isSameResource-com.yahoo.memory.Memory-">isSameResource</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#iterator--">iterator</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#toByteArray--">toByteArray</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#toString--">toString</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#toString-boolean-boolean-int-boolean-">toString</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#toString-byte:A-">toString</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#toString-com.yahoo.memory.Memory-">toString</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#wrap-com.yahoo.memory.Memory-">wrap</a>, <a href="../../../../com/yahoo/sketches/theta/Sketch.html#wrap-com.yahoo.memory.Memory-long-">wrap</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;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">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">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">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">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">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">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">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">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">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">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">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="wrap-com.yahoo.memory.WritableMemory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>wrap</h4>
<pre>public static&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a>&nbsp;wrap(com.yahoo.memory.WritableMemory&nbsp;srcMem)</pre>
<div class="block">Wrap takes the sketch image in Memory and refers to it directly. There is no data copying onto
the java heap. Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have
been explicitly stored as direct objects can be wrapped. This method assumes the
<a href="../../../../com/yahoo/sketches/Util.html#DEFAULT_UPDATE_SEED"><code>Util.DEFAULT_UPDATE_SEED</code></a>.
<a href="../../../../resources/dictionary.html#defaultUpdateSeed">Default Update Seed</a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcMem</code> - an image of a Sketch where the image seed hash matches the default seed hash.
<a href="../../../../resources/dictionary.html#mem">See Memory</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Sketch backed by the given Memory</dd>
</dl>
</li>
</ul>
<a name="wrap-com.yahoo.memory.WritableMemory-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>wrap</h4>
<pre>public static&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a>&nbsp;wrap(com.yahoo.memory.WritableMemory&nbsp;srcMem,
long&nbsp;seed)</pre>
<div class="block">Wrap takes the sketch image in Memory and refers to it directly. There is no data copying onto
the java heap. Only "Direct" Serialization Version 3 (i.e, OpenSource) sketches that have
been explicitly stored as direct objects can be wrapped.
An attempt to "wrap" earlier version sketches will result in a "heapified", normal
Java Heap version of the sketch where all data will be copied to the heap.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcMem</code> - an image of a Sketch where the image seed hash matches the given seed hash.
<a href="../../../../resources/dictionary.html#mem">See Memory</a></dd>
<dd><code>seed</code> - <a href="../../../../resources/dictionary.html#seed">See Update Hash Seed</a>.
Compact sketches store a 16-bit hash of the seed, but not the seed itself.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a UpdateSketch backed by the given Memory</dd>
</dl>
</li>
</ul>
<a name="heapify-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heapify</h4>
<pre>public static&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a>&nbsp;heapify(com.yahoo.memory.Memory&nbsp;srcMem)</pre>
<div class="block">Instantiates an on-heap UpdateSketch from Memory. This method assumes the
<a href="../../../../com/yahoo/sketches/Util.html#DEFAULT_UPDATE_SEED"><code>Util.DEFAULT_UPDATE_SEED</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcMem</code> - <a href="../../../../resources/dictionary.html#mem">See Memory</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an UpdateSketch</dd>
</dl>
</li>
</ul>
<a name="heapify-com.yahoo.memory.Memory-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heapify</h4>
<pre>public static&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a>&nbsp;heapify(com.yahoo.memory.Memory&nbsp;srcMem,
long&nbsp;seed)</pre>
<div class="block">Instantiates an on-heap UpdateSketch from Memory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcMem</code> - <a href="../../../../resources/dictionary.html#mem">See Memory</a></dd>
<dd><code>seed</code> - <a href="../../../../resources/dictionary.html#seed">See Update Hash Seed</a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an UpdateSketch</dd>
</dl>
</li>
</ul>
<a name="compact--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compact</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/CompactSketch.html" title="class in com.yahoo.sketches.theta">CompactSketch</a>&nbsp;compact()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#compact--">Sketch</a></code></span></div>
<div class="block">Converts this sketch to an ordered CompactSketch on the Java heap.
<p>If this sketch is already in compact form this operation returns <i>this</i>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#compact--">compact</a></code>&nbsp;in class&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this sketch as an ordered CompactSketch on the Java heap.</dd>
</dl>
</li>
</ul>
<a name="compact-boolean-com.yahoo.memory.WritableMemory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compact</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/CompactSketch.html" title="class in com.yahoo.sketches.theta">CompactSketch</a>&nbsp;compact(boolean&nbsp;dstOrdered,
com.yahoo.memory.WritableMemory&nbsp;dstMem)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#compact-boolean-com.yahoo.memory.WritableMemory-">Sketch</a></code></span></div>
<div class="block">Convert this sketch to a CompactSketch in the chosen form.
<p>If this sketch is already in compact form this operation returns <i>this</i>.
<p>Otherwise, this compacting process converts the hash table form of an UpdateSketch to
a simple list of the valid hash values from the hash table. Any hash values equal to or
greater than theta will be discarded. The number of valid values remaining in the
Compact Sketch depends on a number of factors, but may be larger or smaller than
<i>Nominal Entries</i> (or <i>k</i>). It will never exceed 2<i>k</i>. If it is critical
to always limit the size to no more than <i>k</i>, then <i>rebuild()</i> should be called
on the UpdateSketch prior to this.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#compact-boolean-com.yahoo.memory.WritableMemory-">compact</a></code>&nbsp;in class&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstOrdered</code> - <a href="../../../../resources/dictionary.html#dstOrdered">See Destination Ordered</a></dd>
<dd><code>dstMem</code> - <a href="../../../../resources/dictionary.html#dstMem">See Destination Memory</a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this sketch as a CompactSketch in the chosen form</dd>
</dl>
</li>
</ul>
<a name="isCompact--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCompact</h4>
<pre>public&nbsp;boolean&nbsp;isCompact()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#isCompact--">Sketch</a></code></span></div>
<div class="block">Returns true if this sketch is in compact form.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#isCompact--">isCompact</a></code>&nbsp;in class&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this sketch is in compact form.</dd>
</dl>
</li>
</ul>
<a name="isOrdered--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOrdered</h4>
<pre>public&nbsp;boolean&nbsp;isOrdered()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#isOrdered--">Sketch</a></code></span></div>
<div class="block">Returns true if internal cache is ordered</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/yahoo/sketches/theta/Sketch.html#isOrdered--">isOrdered</a></code>&nbsp;in class&nbsp;<code><a href="../../../../com/yahoo/sketches/theta/Sketch.html" title="class in com.yahoo.sketches.theta">Sketch</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if internal cache is ordered</dd>
</dl>
</li>
</ul>
<a name="builder--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>builder</h4>
<pre>public static final&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketchBuilder.html" title="class in com.yahoo.sketches.theta">UpdateSketchBuilder</a>&nbsp;builder()</pre>
<div class="block">Returns a new builder</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new builder</dd>
</dl>
</li>
</ul>
<a name="reset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public abstract&nbsp;void&nbsp;reset()</pre>
<div class="block">Resets this sketch back to a virgin empty state.</div>
</li>
</ul>
<a name="rebuild--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rebuild</h4>
<pre>public abstract&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html" title="class in com.yahoo.sketches.theta">UpdateSketch</a>&nbsp;rebuild()</pre>
<div class="block">Rebuilds the hash table to remove dirty values or to reduce the size
to nominal entries.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this sketch</dd>
</dl>
</li>
</ul>
<a name="getResizeFactor--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResizeFactor</h4>
<pre>public abstract&nbsp;<a href="../../../../com/yahoo/sketches/ResizeFactor.html" title="enum in com.yahoo.sketches">ResizeFactor</a>&nbsp;getResizeFactor()</pre>
<div class="block">Returns the configured ResizeFactor</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the configured ResizeFactor</dd>
</dl>
</li>
</ul>
<a name="update-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(long&nbsp;datum)</pre>
<div class="block">Present this sketch with a long.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>datum</code> - The given long datum.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(double&nbsp;datum)</pre>
<div class="block">Present this sketch with the given double (or float) datum.
The double will be converted to a long using Double.doubleToLongBits(datum),
which normalizes all NaN values to a single NaN representation.
Plus and minus zero will be normalized to plus zero.
The special floating-point values NaN and +/- Infinity are treated as distinct.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>datum</code> - The given double datum.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;datum)</pre>
<div class="block">Present this sketch with the given String.
The string is converted to a byte array using UTF8 encoding.
If the string is null or empty no update attempt is made and the method returns.
<p>Note: this will not produce the same output hash values as the <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-char:A-"><code>update(char[])</code></a>
method and will generally be a little slower depending on the complexity of the UTF8 encoding.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>datum</code> - The given String.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(byte[]&nbsp;data)</pre>
<div class="block">Present this sketch with the given byte array.
If the byte array is null or empty no update attempt is made and the method returns.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The given byte array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-char:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(char[]&nbsp;data)</pre>
<div class="block">Present this sketch with the given char array.
If the char array is null or empty no update attempt is made and the method returns.
<p>Note: this will not produce the same output hash values as the <a href="../../../../com/yahoo/sketches/theta/UpdateSketch.html#update-java.lang.String-"><code>update(String)</code></a>
method but will be a little faster as it avoids the complexity of the UTF8 encoding.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The given char array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-int:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(int[]&nbsp;data)</pre>
<div class="block">Present this sketch with the given integer array.
If the integer array is null or empty no update attempt is made and the method returns.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The given int array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="update-long:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta">UpdateReturnState</a>&nbsp;update(long[]&nbsp;data)</pre>
<div class="block">Present this sketch with the given long array.
If the long array is null or empty no update attempt is made and the method returns.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - The given long array.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../resources/dictionary.html#updateReturnState">See Update Return State</a></dd>
</dl>
</li>
</ul>
<a name="getLgNomLongs--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getLgNomLongs</h4>
<pre>public abstract&nbsp;int&nbsp;getLgNomLongs()</pre>
<div class="block">Gets the Log base 2 of the configured nominal entries</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the Log base 2 of the configured nominal entries</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UpdateSketch.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">
<li><a href="../../../../com/yahoo/sketches/theta/UpdateReturnState.html" title="enum in com.yahoo.sketches.theta"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../com/yahoo/sketches/theta/UpdateSketchBuilder.html" title="class in com.yahoo.sketches.theta"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/theta/UpdateSketch.html" target="_top">Frames</a></li>
<li><a href="UpdateSketch.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2019. All rights reserved.</small></p>
</body>
</html>