blob: da53ab8e778f69693eb599f27ca8ee132f4c1352 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>UpdatableSketch (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="UpdatableSketch (datasketches-java 4.0.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":42,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated 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/UpdatableSketch.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&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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">&nbsp;</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>&nbsp;<a href="package-summary.html">org.apache.datasketches.tuple</a></div>
<h2 title="Class UpdatableSketch" class="title">Class UpdatableSketch&lt;U,&#8203;S extends <a href="UpdatableSummary.html" title="interface in org.apache.datasketches.tuple">UpdatableSummary</a>&lt;U&gt;&gt;</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><a href="Sketch.html" title="class in org.apache.datasketches.tuple">org.apache.datasketches.tuple.Sketch</a>&lt;S&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.datasketches.tuple.UpdatableSketch&lt;U,&#8203;S&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>U</code> - Type of the value, which is passed to update method of a Summary</dd>
<dd><code>S</code> - Type of the UpdatableSummary&lt;U&gt;</dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="strings/ArrayOfStringsSketch.html" title="class in org.apache.datasketches.tuple.strings">ArrayOfStringsSketch</a></code>, <code><a href="adouble/DoubleSketch.html" title="class in org.apache.datasketches.tuple.adouble">DoubleSketch</a></code>, <code><a href="aninteger/IntegerSketch.html" title="class in org.apache.datasketches.tuple.aninteger">IntegerSketch</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">UpdatableSketch&lt;U,&#8203;S extends <a href="UpdatableSummary.html" title="interface in org.apache.datasketches.tuple">UpdatableSummary</a>&lt;U&gt;&gt;</span>
extends <a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S&gt;</pre>
<div class="block">An extension of QuickSelectSketch&lt;S&gt;, which can be updated with many types of keys.
Summary objects are created using a user-defined SummaryFactory class,
which should allow very flexible parameterization if needed.
Keys are presented to a sketch along with values of a user-defined
update type U. When an entry is inserted into a sketch or a duplicate key is
presented to a sketch then summary.update(U value) method will be called. So
any kind of user-defined accumulation is possible. Summaries also must know
how to copy themselves. Also union and intersection of summaries can be
implemented in a sub-class of SummarySetOperations, which will be used in
case Union or Intersection of two instances of Tuple Sketch is needed</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.apache.datasketches.tuple.Sketch">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.datasketches.tuple.<a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a></h3>
<code><a href="Sketch.html#PREAMBLE_LONGS">PREAMBLE_LONGS</a>, <a href="Sketch.html#summaryFactory_">summaryFactory_</a></code></li>
</ul>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int,float,org.apache.datasketches.tuple.SummaryFactory)">UpdatableSketch</a></span>&#8203;(int&nbsp;nomEntries,
int&nbsp;lgResizeFactor,
float&nbsp;samplingProbability,
<a href="SummaryFactory.html" title="interface in org.apache.datasketches.tuple">SummaryFactory</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;summaryFactory)</code></th>
<td class="colLast">
<div class="block">This is to create a new instance of an UpdatableQuickSelectSketch.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.datasketches.memory.Memory,org.apache.datasketches.tuple.SummaryDeserializer,org.apache.datasketches.tuple.SummaryFactory)">UpdatableSketch</a></span>&#8203;(org.apache.datasketches.memory.Memory&nbsp;srcMem,
<a href="SummaryDeserializer.html" title="interface in org.apache.datasketches.tuple">SummaryDeserializer</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;deserializer,
<a href="SummaryFactory.html" title="interface in org.apache.datasketches.tuple">SummaryFactory</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;summaryFactory)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of 3.0.0, heapifying an UpdatableSketch is deprecated.</div>
</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.datasketches.tuple.UpdatableSketch)">UpdatableSketch</a></span>&#8203;(<a href="UpdatableSketch.html" title="class in org.apache.datasketches.tuple">UpdatableSketch</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>,&#8203;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;sketch)</code></th>
<td class="colLast">
<div class="block">Copy Constructor</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== 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">&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="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</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="CompactSketch.html" title="class in org.apache.datasketches.tuple">CompactSketch</a>&lt;S&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compact()">compact</a></span>()</code></th>
<td class="colLast">
<div class="block">Converts the current state of the sketch into a compact sketch</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="UpdatableSketch.html" title="class in org.apache.datasketches.tuple">UpdatableSketch</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>,&#8203;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copy()">copy</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCountLessThanThetaLong(long)">getCountLessThanThetaLong</a></span>&#8203;(long&nbsp;thetaLong)</code></th>
<td class="colLast">
<div class="block">Gets the number of hash values less than the given theta expressed as a long.</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="#getCurrentCapacity()">getCurrentCapacity</a></span>()</code></th>
<td class="colLast">
<div class="block">Get current capacity</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLgK()">getLgK</a></span>()</code></th>
<td class="colLast">
<div class="block">Get log_base2 of Nominal Entries</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNominalEntries()">getNominalEntries</a></span>()</code></th>
<td class="colLast">
<div class="block">Get configured nominal number of entries</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../common/ResizeFactor.html" title="enum in org.apache.datasketches.common">ResizeFactor</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getResizeFactor()">getResizeFactor</a></span>()</code></th>
<td class="colLast">
<div class="block">Get configured resize factor</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRetainedEntries()">getRetainedEntries</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>float</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSamplingProbability()">getSamplingProbability</a></span>()</code></th>
<td class="colLast">
<div class="block">Get configured sampling probability</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#insertSummary(int,S)">insertSummary</a></span>&#8203;(int&nbsp;index,
S&nbsp;summary)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="TupleSketchIterator.html" title="class in org.apache.datasketches.tuple">TupleSketchIterator</a>&lt;S&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#iterator()">iterator</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a SketchIterator</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<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 an empty state.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<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"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of 3.0.0, serializing an UpdatableSketch is deprecated.</div>
</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="#trim()">trim</a></span>()</code></th>
<td class="colLast">
<div class="block">Rebuilds reducing the actual number of entries to the nominal number of entries if needed</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(byte%5B%5D,U)">update</a></span>&#8203;(byte[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a byte[] key and U value.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(double,U)">update</a></span>&#8203;(double&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a double key and U value.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(int%5B%5D,U)">update</a></span>&#8203;(int[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a int[] key and U value.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(long%5B%5D,U)">update</a></span>&#8203;(long[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a long[] key and U value.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(long,U)">update</a></span>&#8203;(long&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a long key and U value.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#update(java.lang.String,U)">update</a></span>&#8203;(<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>&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</code></th>
<td class="colLast">
<div class="block">Updates this sketch with a String key and U value.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.datasketches.tuple.Sketch">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.datasketches.tuple.<a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a></h3>
<code><a href="Sketch.html#getEstimate()">getEstimate</a>, <a href="Sketch.html#getEstimate(int)">getEstimate</a>, <a href="Sketch.html#getLowerBound(int)">getLowerBound</a>, <a href="Sketch.html#getLowerBound(int,int)">getLowerBound</a>, <a href="Sketch.html#getSummaryFactory()">getSummaryFactory</a>, <a href="Sketch.html#getTheta()">getTheta</a>, <a href="Sketch.html#getThetaLong()">getThetaLong</a>, <a href="Sketch.html#getUpperBound(int)">getUpperBound</a>, <a href="Sketch.html#getUpperBound(int,int)">getUpperBound</a>, <a href="Sketch.html#isEmpty()">isEmpty</a>, <a href="Sketch.html#isEstimationMode()">isEstimationMode</a>, <a href="Sketch.html#toString()">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="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" 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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(int,int,float,org.apache.datasketches.tuple.SummaryFactory)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>UpdatableSketch</h4>
<pre>public&nbsp;UpdatableSketch&#8203;(int&nbsp;nomEntries,
int&nbsp;lgResizeFactor,
float&nbsp;samplingProbability,
<a href="SummaryFactory.html" title="interface in org.apache.datasketches.tuple">SummaryFactory</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;summaryFactory)</pre>
<div class="block">This is to create a new instance of an UpdatableQuickSelectSketch.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nomEntries</code> - Nominal number of entries. Forced to the nearest power of 2 greater than
or equal to the given value.</dd>
<dd><code>lgResizeFactor</code> - log2(resizeFactor) - value from 0 to 3:
<pre>
0 - no resizing (max size allocated),
1 - double internal hash table each time it reaches a threshold
2 - grow four times
3 - grow eight times (default)
</pre></dd>
<dd><code>samplingProbability</code> - <a href="../../../../resources/dictionary.html#p">See Sampling Probability</a></dd>
<dd><code>summaryFactory</code> - An instance of a SummaryFactory.</dd>
</dl>
</li>
</ul>
<a id="&lt;init&gt;(org.apache.datasketches.memory.Memory,org.apache.datasketches.tuple.SummaryDeserializer,org.apache.datasketches.tuple.SummaryFactory)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>UpdatableSketch</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a>
public&nbsp;UpdatableSketch&#8203;(org.apache.datasketches.memory.Memory&nbsp;srcMem,
<a href="SummaryDeserializer.html" title="interface in org.apache.datasketches.tuple">SummaryDeserializer</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;deserializer,
<a href="SummaryFactory.html" title="interface in org.apache.datasketches.tuple">SummaryFactory</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;summaryFactory)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of 3.0.0, heapifying an UpdatableSketch is deprecated.
This capability will be removed in a future release.
Heapifying a CompactSketch is not deprecated.</div>
</div>
<div class="block">This is to create an instance of a sketch given a serialized form</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcMem</code> - Memory object with data of a serialized UpdatableSketch</dd>
<dd><code>deserializer</code> - instance of SummaryDeserializer</dd>
<dd><code>summaryFactory</code> - instance of SummaryFactory</dd>
</dl>
</li>
</ul>
<a id="&lt;init&gt;(org.apache.datasketches.tuple.UpdatableSketch)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>UpdatableSketch</h4>
<pre>public&nbsp;UpdatableSketch&#8203;(<a href="UpdatableSketch.html" title="class in org.apache.datasketches.tuple">UpdatableSketch</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>,&#8203;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;sketch)</pre>
<div class="block">Copy Constructor</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sketch</code> - the sketch to copy</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="copy()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre class="methodSignature">public&nbsp;<a href="UpdatableSketch.html" title="class in org.apache.datasketches.tuple">UpdatableSketch</a>&lt;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>,&#8203;<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">S</a>&gt;&nbsp;copy()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a deep copy of this sketch</dd>
</dl>
</li>
</ul>
<a id="update(long,java.lang.Object)">
<!-- -->
</a><a id="update(long,U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(long&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a long key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given long key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="update(double,java.lang.Object)">
<!-- -->
</a><a id="update(double,U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(double&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a double key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given double key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="update(java.lang.String,java.lang.Object)">
<!-- -->
</a><a id="update(java.lang.String,U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(<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>&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a String key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given String key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="update(byte[],java.lang.Object)">
<!-- -->
</a><a id="update(byte[],U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(byte[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a byte[] key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given byte[] key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="update(int[],java.lang.Object)">
<!-- -->
</a><a id="update(int[],U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(int[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a int[] key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given int[] key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="update(long[],java.lang.Object)">
<!-- -->
</a><a id="update(long[],U)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;update&#8203;(long[]&nbsp;key,
<a href="UpdatableSketch.html" title="type parameter in UpdatableSketch">U</a>&nbsp;value)</pre>
<div class="block">Updates this sketch with a long[] key and U value.
The value is passed to update() method of the Summary object associated with the key</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - The given long[] key</dd>
<dd><code>value</code> - The given U value</dd>
</dl>
</li>
</ul>
<a id="getRetainedEntries()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRetainedEntries</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getRetainedEntries()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Sketch.html#getRetainedEntries()">getRetainedEntries</a></code>&nbsp;in class&nbsp;<code><a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S extends <a href="Summary.html" title="interface in org.apache.datasketches.tuple">Summary</a>&gt;</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of retained entries</dd>
</dl>
</li>
</ul>
<a id="getCountLessThanThetaLong(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCountLessThanThetaLong</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getCountLessThanThetaLong&#8203;(long&nbsp;thetaLong)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="Sketch.html#getCountLessThanThetaLong(long)">Sketch</a></code></span></div>
<div class="block">Gets the number of hash values less than the given theta expressed as a long.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Sketch.html#getCountLessThanThetaLong(long)">getCountLessThanThetaLong</a></code>&nbsp;in class&nbsp;<code><a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S extends <a href="Summary.html" title="interface in org.apache.datasketches.tuple">Summary</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>thetaLong</code> - the given theta as a long between zero and <i>Long.MAX_VALUE</i>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of hash values less than the given thetaLong.</dd>
</dl>
</li>
</ul>
<a id="getNominalEntries()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNominalEntries</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getNominalEntries()</pre>
<div class="block">Get configured nominal number of entries</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>nominal number of entries</dd>
</dl>
</li>
</ul>
<a id="getLgK()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLgK</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getLgK()</pre>
<div class="block">Get log_base2 of Nominal Entries</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>log_base2 of Nominal Entries</dd>
</dl>
</li>
</ul>
<a id="getSamplingProbability()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSamplingProbability</h4>
<pre class="methodSignature">public&nbsp;float&nbsp;getSamplingProbability()</pre>
<div class="block">Get configured sampling probability</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>sampling probability</dd>
</dl>
</li>
</ul>
<a id="getCurrentCapacity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentCapacity</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getCurrentCapacity()</pre>
<div class="block">Get current capacity</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>current capacity</dd>
</dl>
</li>
</ul>
<a id="getResizeFactor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResizeFactor</h4>
<pre class="methodSignature">public&nbsp;<a href="../common/ResizeFactor.html" title="enum in org.apache.datasketches.common">ResizeFactor</a>&nbsp;getResizeFactor()</pre>
<div class="block">Get configured resize factor</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>resize factor</dd>
</dl>
</li>
</ul>
<a id="trim()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>trim</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;trim()</pre>
<div class="block">Rebuilds reducing the actual number of entries to the nominal number of entries if needed</div>
</li>
</ul>
<a id="reset()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;reset()</pre>
<div class="block">Resets this sketch an empty state.</div>
</li>
</ul>
<a id="compact()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compact</h4>
<pre class="methodSignature">public&nbsp;<a href="CompactSketch.html" title="class in org.apache.datasketches.tuple">CompactSketch</a>&lt;S&gt;&nbsp;compact()</pre>
<div class="block">Converts the current state of the sketch into a compact sketch</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Sketch.html#compact()">compact</a></code>&nbsp;in class&nbsp;<code><a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S extends <a href="Summary.html" title="interface in org.apache.datasketches.tuple">Summary</a>&gt;</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>compact sketch</dd>
</dl>
</li>
</ul>
<a id="toByteArray()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toByteArray</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a>
public&nbsp;byte[]&nbsp;toByteArray()</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">As of 3.0.0, serializing an UpdatableSketch is deprecated.
This capability will be removed in a future release.
Serializing a CompactSketch is not deprecated.</div>
</div>
<div class="block">This serializes an UpdatableSketch (QuickSelectSketch).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Sketch.html#toByteArray()">toByteArray</a></code>&nbsp;in class&nbsp;<code><a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S extends <a href="Summary.html" title="interface in org.apache.datasketches.tuple">Summary</a>&gt;</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>serialized representation of an UpdatableSketch (QuickSelectSketch).</dd>
</dl>
</li>
</ul>
<a id="insertSummary(int,org.apache.datasketches.tuple.Summary)">
<!-- -->
</a><a id="insertSummary(int,S)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>insertSummary</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;insertSummary&#8203;(int&nbsp;index,
S&nbsp;summary)</pre>
</li>
</ul>
<a id="iterator()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>iterator</h4>
<pre class="methodSignature">public&nbsp;<a href="TupleSketchIterator.html" title="class in org.apache.datasketches.tuple">TupleSketchIterator</a>&lt;S&gt;&nbsp;iterator()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="Sketch.html#iterator()">Sketch</a></code></span></div>
<div class="block">Returns a SketchIterator</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="Sketch.html#iterator()">iterator</a></code>&nbsp;in class&nbsp;<code><a href="Sketch.html" title="class in org.apache.datasketches.tuple">Sketch</a>&lt;S extends <a href="Summary.html" title="interface in org.apache.datasketches.tuple">Summary</a>&gt;</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a SketchIterator</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/UpdatableSketch.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&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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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 &#169; 2015&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>