blob: 673f42739ba98045dad8273e7e97ed98baa16567 [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 Oct 25 17:06:10 PDT 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Union (com.yahoo.datasketches:sketches-core 0.12.1-SNAPSHOT API)</title>
<meta name="date" content="2018-10-25">
<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="Union (com.yahoo.datasketches:sketches-core 0.12.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":10,"i7":10,"i8":10,"i9":9,"i10":9,"i11":10,"i12":10,"i13":10,"i14":9,"i15":9,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":9};
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";
</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/Union.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/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/hll/Union.html" target="_top">Frames</a></li>
<li><a href="Union.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><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 name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.yahoo.sketches.hll</div>
<h2 title="Class Union" class="title">Class Union</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>com.yahoo.sketches.hll.Union</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">Union</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">Object</a></pre>
<div class="block">This performs union operations for HLL sketches. This union operator is configured with a
<i>lgMaxK</i> instead of the normal <i>lgConfigK</i>.
<p>This union operator does permit the unioning of sketches with different values of
<i>lgConfigK</i>. The user should be aware that the resulting accuracy of a sketch returned
at the end of the unioning process will be a function of the smallest of <i>lgMaxK</i> and
<i>lgConfigK</i> that the union operator has seen.
<p>This union operator also permits unioning of any of the three different target HllSketch
types.
<p>Although the API for this union operator parallels many of the methods of the
<i>HllSketch</i>, the behavior of the union operator has some fundamental differences.
<p>First, the user cannot specify the <a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><code>TgtHllType</code></a> as an input parameter.
Instead, it is specified for the sketch returned with <a href="../../../../com/yahoo/sketches/hll/Union.html#getResult-com.yahoo.sketches.hll.TgtHllType-"><code>getResult(TgtHllType)</code></a>.
<p>Second, the internal effective value of log-base-2 of <i>K</i> for the union operation can
change dynamically based on the smallest <i>lgConfigK</i> that the union operation has seen.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Lee Rhodes, Kevin Lang</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#Union-int-">Union</a></span>(int&nbsp;lgMaxK)</code>
<div class="block">Construct this Union operator with a given maximum log-base-2 of <i>K</i>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#Union-int-com.yahoo.memory.WritableMemory-">Union</a></span>(int&nbsp;lgMaxK,
com.yahoo.memory.WritableMemory&nbsp;dstMem)</code>
<div class="block">Construct this Union operator with a given maximum log-base-2 of <i>K</i> and the given
WritableMemory as the destination for this Union.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== 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="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>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getCompactSerializationBytes--">getCompactSerializationBytes</a></span>()</code>
<div class="block">Gets the size in bytes of the current sketch when serialized using
<i>toCompactByteArray()</i>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getCompositeEstimate--">getCompositeEstimate</a></span>()</code>
<div class="block">This is less accurate than the <a href="../../../../com/yahoo/sketches/hll/Union.html#getEstimate--"><code>getEstimate()</code></a> method and is automatically used
when the sketch has gone through union operations where the more accurate HIP estimator
cannot be used.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getEstimate--">getEstimate</a></span>()</code>
<div class="block">Return the cardinality estimate</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getLgConfigK--">getLgConfigK</a></span>()</code>
<div class="block">Gets the effective <i>lgConfigK</i> for the union operator, which may be less than
<i>lgMaxK</i>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getLowerBound-int-">getLowerBound</a></span>(int&nbsp;numStdDev)</code>
<div class="block">Gets the approximate lower error bound given the specified number of Standard Deviations.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getMaxSerializationBytes-int-">getMaxSerializationBytes</a></span>(int&nbsp;lgK)</code>
<div class="block">Returns the maximum size in bytes that this union operator can grow to given a lgK.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getRelErr-boolean-boolean-int-int-">getRelErr</a></span>(boolean&nbsp;upperBound,
boolean&nbsp;unioned,
int&nbsp;lgConfigK,
int&nbsp;numStdDev)</code>
<div class="block">Gets the current (approximate) Relative Error (RE) asymptotic values given several
parameters.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getResult--">getResult</a></span>()</code>
<div class="block">Return the result of this union operator as an HLL_4 sketch.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getResult-com.yahoo.sketches.hll.TgtHllType-">getResult</a></span>(<a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll">TgtHllType</a>&nbsp;tgtHllType)</code>
<div class="block">Return the result of this union operator with the specified <a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><code>TgtHllType</code></a></div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getSerializationVersion--">getSerializationVersion</a></span>()</code>
<div class="block">Returns the current serialization version.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getSerializationVersion-com.yahoo.memory.Memory-">getSerializationVersion</a></span>(com.yahoo.memory.Memory&nbsp;mem)</code>
<div class="block">Returns the current serialization version of the given Memory.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll">TgtHllType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getTgtHllType--">getTgtHllType</a></span>()</code>
<div class="block">Gets the <a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><code>TgtHllType</code></a></div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getUpdatableSerializationBytes--">getUpdatableSerializationBytes</a></span>()</code>
<div class="block">Gets the size in bytes of the current sketch when serialized using
<i>toUpdatableByteArray()</i>.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#getUpperBound-int-">getUpperBound</a></span>(int&nbsp;numStdDev)</code>
<div class="block">Gets the approximate upper error bound given the specified number of Standard Deviations.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#heapify-byte:A-">heapify</a></span>(byte[]&nbsp;byteArray)</code>
<div class="block">Construct a union operator populated with the given byte array image of an HllSketch.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#heapify-com.yahoo.memory.Memory-">heapify</a></span>(com.yahoo.memory.Memory&nbsp;mem)</code>
<div class="block">Construct a union operator populated with the given Memory image of an HllSketch.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isCompact--">isCompact</a></span>()</code>
<div class="block">Returns true if the backing memory of this sketch is in compact form.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isEmpty--">isEmpty</a></span>()</code>
<div class="block">Returns true if empty</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isEstimationMode--">isEstimationMode</a></span>()</code>
<div class="block">This HLL family of sketches and operators is always estimating, even for very small values.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isMemory--">isMemory</a></span>()</code>
<div class="block">Returns true if this sketch was created using Memory.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isOffHeap--">isOffHeap</a></span>()</code>
<div class="block">Returns true if the backing memory for this sketch is off-heap.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#isSameResource-com.yahoo.memory.Memory-">isSameResource</a></span>(com.yahoo.memory.Memory&nbsp;mem)</code>
<div class="block">Returns true if the given Memory refers to the same underlying resource as this sketch.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#reset--">reset</a></span>()</code>
<div class="block">Resets to empty and retains the current lgK, but does not change the configured value of
lgMaxK.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#toCompactByteArray--">toCompactByteArray</a></span>()</code>
<div class="block">Gets the serialization of this union operator as a byte array in compact form, which is
designed to be heapified only.</div>
</td>
</tr>
<tr id="i24" 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">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#toString--">toString</a></span>()</code>
<div class="block">Human readable summary as a string.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<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">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#toString-boolean-boolean-boolean-">toString</a></span>(boolean&nbsp;summary,
boolean&nbsp;detail,
boolean&nbsp;auxDetail)</code>
<div class="block">Human readable summary with optional detail.</div>
</td>
</tr>
<tr id="i26" 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">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#toString-boolean-boolean-boolean-boolean-">toString</a></span>(boolean&nbsp;summary,
boolean&nbsp;hllDetail,
boolean&nbsp;auxDetail,
boolean&nbsp;all)</code>
<div class="block">Human readable summary with optional detail</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#toUpdatableByteArray--">toUpdatableByteArray</a></span>()</code>
<div class="block">Serializes this sketch as an updatable byte array.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-byte:A-">update</a></span>(byte[]&nbsp;data)</code>
<div class="block">Present the given byte array as a potential unique item.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-char:A-">update</a></span>(char[]&nbsp;data)</code>
<div class="block">Present the given char array as a potential unique item.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-double-">update</a></span>(double&nbsp;datum)</code>
<div class="block">Present the given double (or float) datum as a potential unique item.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-com.yahoo.sketches.hll.HllSketch-">update</a></span>(<a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a>&nbsp;sketch)</code>
<div class="block">Update this union operator with the given sketch.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-int:A-">update</a></span>(int[]&nbsp;data)</code>
<div class="block">Present the given integer array as a potential unique item.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-long-">update</a></span>(long&nbsp;datum)</code>
<div class="block">Present the given long as a potential unique item.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#update-long:A-">update</a></span>(long[]&nbsp;data)</code>
<div class="block">Present the given long array as a potential unique item.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.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 the given String as a potential unique item.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/yahoo/sketches/hll/Union.html#writableWrap-com.yahoo.memory.WritableMemory-">writableWrap</a></span>(com.yahoo.memory.WritableMemory&nbsp;wmem)</code>
<div class="block">Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch,
and may have data.</div>
</td>
</tr>
</table>
<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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Union-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(int&nbsp;lgMaxK)</pre>
<div class="block">Construct this Union operator with a given maximum log-base-2 of <i>K</i>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lgMaxK</code> - the desired maximum log-base-2 of <i>K</i>. This value must be
between 7 and 21 inclusively.</dd>
</dl>
</li>
</ul>
<a name="Union-int-com.yahoo.memory.WritableMemory-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(int&nbsp;lgMaxK,
com.yahoo.memory.WritableMemory&nbsp;dstMem)</pre>
<div class="block">Construct this Union operator with a given maximum log-base-2 of <i>K</i> and the given
WritableMemory as the destination for this Union. This WritableMemory is usually configured
for off-heap memory. What remains on the java heap is a thin wrapper object that reads and
writes to the given WritableMemory.
<p>The given <i>dstMem</i> is checked for the required capacity as determined by
<a href="../../../../com/yahoo/sketches/hll/HllSketch.html#getMaxUpdatableSerializationBytes-int-com.yahoo.sketches.hll.TgtHllType-"><code>HllSketch.getMaxUpdatableSerializationBytes(int, TgtHllType)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lgMaxK</code> - the desired maximum log-base-2 of <i>K</i>. This value must be
between 7 and 21 inclusively.</dd>
<dd><code>dstMem</code> - the destination memory for the sketch.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="heapify-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heapify</h4>
<pre>public static final&nbsp;<a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a>&nbsp;heapify(byte[]&nbsp;byteArray)</pre>
<div class="block">Construct a union operator populated with the given byte array image of an HllSketch.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>byteArray</code> - the given byte array</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a union operator populated with the given byte array image of an HllSketch.</dd>
</dl>
</li>
</ul>
<a name="heapify-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heapify</h4>
<pre>public static final&nbsp;<a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a>&nbsp;heapify(com.yahoo.memory.Memory&nbsp;mem)</pre>
<div class="block">Construct a union operator populated with the given Memory image of an HllSketch.</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 union operator populated with the given Memory image of an HllSketch.</dd>
</dl>
</li>
</ul>
<a name="writableWrap-com.yahoo.memory.WritableMemory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writableWrap</h4>
<pre>public static final&nbsp;<a href="../../../../com/yahoo/sketches/hll/Union.html" title="class in com.yahoo.sketches.hll">Union</a>&nbsp;writableWrap(com.yahoo.memory.WritableMemory&nbsp;wmem)</pre>
<div class="block">Wraps the given WritableMemory, which must be a image of a valid updatable HLL_8 sketch,
and may have data. What remains on the java heap is a
thin wrapper object that reads and writes to the given WritableMemory, which, depending on
how the user configures the WritableMemory, may actually reside on the Java heap or off-heap.
<p>The given <i>dstMem</i> is checked for the required capacity as determined by
<a href="../../../../com/yahoo/sketches/hll/HllSketch.html#getMaxUpdatableSerializationBytes-int-com.yahoo.sketches.hll.TgtHllType-"><code>HllSketch.getMaxUpdatableSerializationBytes(int, TgtHllType)</code></a>, and for the correct type.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>wmem</code> - an writable image of a valid sketch with data.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Union operator where the sketch data is in the given dstMem.</dd>
</dl>
</li>
</ul>
<a name="getCompositeEstimate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCompositeEstimate</h4>
<pre>public&nbsp;double&nbsp;getCompositeEstimate()</pre>
<div class="block">This is less accurate than the <a href="../../../../com/yahoo/sketches/hll/Union.html#getEstimate--"><code>getEstimate()</code></a> method and is automatically used
when the sketch has gone through union operations where the more accurate HIP estimator
cannot be used.
This is made public only for error characterization software that exists in separate
packages and is not intended for normal use.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the composite estimate</dd>
</dl>
</li>
</ul>
<a name="getCompactSerializationBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCompactSerializationBytes</h4>
<pre>public&nbsp;int&nbsp;getCompactSerializationBytes()</pre>
<div class="block">Gets the size in bytes of the current sketch when serialized using
<i>toCompactByteArray()</i>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the size in bytes of the current sketch when serialized using
<i>toCompactByteArray()</i>.</dd>
</dl>
</li>
</ul>
<a name="getEstimate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEstimate</h4>
<pre>public&nbsp;double&nbsp;getEstimate()</pre>
<div class="block">Return the cardinality estimate</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the cardinality estimate</dd>
</dl>
</li>
</ul>
<a name="getLgConfigK--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLgConfigK</h4>
<pre>public&nbsp;int&nbsp;getLgConfigK()</pre>
<div class="block">Gets the effective <i>lgConfigK</i> for the union operator, which may be less than
<i>lgMaxK</i>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the <i>lgConfigK</i>.</dd>
</dl>
</li>
</ul>
<a name="getMaxSerializationBytes-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxSerializationBytes</h4>
<pre>public static&nbsp;int&nbsp;getMaxSerializationBytes(int&nbsp;lgK)</pre>
<div class="block">Returns the maximum size in bytes that this union operator can grow to given a lgK.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lgK</code> - The maximum Log2 of K for this union operator. This value must be
between 4 and 21 inclusively.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum size in bytes that this union operator can grow to.</dd>
</dl>
</li>
</ul>
<a name="getLowerBound-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLowerBound</h4>
<pre>public&nbsp;double&nbsp;getLowerBound(int&nbsp;numStdDev)</pre>
<div class="block">Gets the approximate lower error bound given the specified number of Standard Deviations.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>numStdDev</code> - This must be an integer between 1 and 3, inclusive.
<a href="../../../../resources/dictionary.html#numStdDev">See Number of Standard Deviations</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the lower bound.</dd>
</dl>
</li>
</ul>
<a name="getResult--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResult</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a>&nbsp;getResult()</pre>
<div class="block">Return the result of this union operator as an HLL_4 sketch.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the result of this union operator as an HLL_4 sketch.</dd>
</dl>
</li>
</ul>
<a name="getResult-com.yahoo.sketches.hll.TgtHllType-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResult</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a>&nbsp;getResult(<a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll">TgtHllType</a>&nbsp;tgtHllType)</pre>
<div class="block">Return the result of this union operator with the specified <a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><code>TgtHllType</code></a></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tgtHllType</code> - the TgtHllType enum</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the result of this union operator with the specified TgtHllType</dd>
</dl>
</li>
</ul>
<a name="getTgtHllType--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTgtHllType</h4>
<pre>public&nbsp;<a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll">TgtHllType</a>&nbsp;getTgtHllType()</pre>
<div class="block">Gets the <a href="../../../../com/yahoo/sketches/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><code>TgtHllType</code></a></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the TgtHllType enum value</dd>
</dl>
</li>
</ul>
<a name="getUpdatableSerializationBytes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUpdatableSerializationBytes</h4>
<pre>public&nbsp;int&nbsp;getUpdatableSerializationBytes()</pre>
<div class="block">Gets the size in bytes of the current sketch when serialized using
<i>toUpdatableByteArray()</i>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the size in bytes of the current sketch when serialized using
<i>toUpdatableByteArray()</i>.</dd>
</dl>
</li>
</ul>
<a name="getUpperBound-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUpperBound</h4>
<pre>public&nbsp;double&nbsp;getUpperBound(int&nbsp;numStdDev)</pre>
<div class="block">Gets the approximate upper error bound given the specified number of Standard Deviations.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>numStdDev</code> - This must be an integer between 1 and 3, inclusive.
<a href="../../../../resources/dictionary.html#numStdDev">Number of Standard Deviations</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the upper bound.</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">Returns true if the backing memory of this sketch is in compact form.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the backing memory of this sketch is in compact form.</dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Returns true if empty</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if empty</dd>
</dl>
</li>
</ul>
<a name="isMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isMemory</h4>
<pre>public&nbsp;boolean&nbsp;isMemory()</pre>
<div class="block">Returns true if this sketch was created using Memory.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this sketch was created using Memory.</dd>
</dl>
</li>
</ul>
<a name="isOffHeap--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOffHeap</h4>
<pre>public&nbsp;boolean&nbsp;isOffHeap()</pre>
<div class="block">Returns true if the backing memory for this sketch is off-heap.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the backing memory for this sketch is off-heap.</dd>
</dl>
</li>
</ul>
<a name="isSameResource-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSameResource</h4>
<pre>public&nbsp;boolean&nbsp;isSameResource(com.yahoo.memory.Memory&nbsp;mem)</pre>
<div class="block">Returns true if the given Memory refers to the same underlying resource as this sketch.
The capacities must be the same. If <i>this</i> is a region,
the region offset must also be the same.
<p>This is only relevant for HLL_4 sketches that have been configured for off-heap
using WritableMemory or Memory. For on-heap sketches or unions this will return false.
<p>It is rare, but possible, the the off-heap memory that has been allocated to an HLL_4
sketch may not be large enough. If this should happen, the sketch makes a request for more
memory from the owner of the resource and then moves itself to this new location. This all
happens transparently to the user. This method provides a means for the user to
inquire of the sketch if it has, in fact, moved itself.</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>true if the given Memory refers to the same underlying resource as this sketch or
union.</dd>
</dl>
</li>
</ul>
<a name="reset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public&nbsp;void&nbsp;reset()</pre>
<div class="block">Resets to empty and retains the current lgK, but does not change the configured value of
lgMaxK.</div>
</li>
</ul>
<a name="toCompactByteArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toCompactByteArray</h4>
<pre>public&nbsp;byte[]&nbsp;toCompactByteArray()</pre>
<div class="block">Gets the serialization of this union operator as a byte array in compact form, which is
designed to be heapified only. It is not directly updatable.
For the Union operator, this is the serialization of the internal state of
the union operator as a sketch.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the serialization of this union operator as a byte array.</dd>
</dl>
</li>
</ul>
<a name="toUpdatableByteArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toUpdatableByteArray</h4>
<pre>public&nbsp;byte[]&nbsp;toUpdatableByteArray()</pre>
<div class="block">Serializes this sketch as an updatable byte array.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this sketch as an updatable byte array.</dd>
</dl>
</li>
</ul>
<a name="toString-boolean-boolean-boolean-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<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;toString(boolean&nbsp;summary,
boolean&nbsp;hllDetail,
boolean&nbsp;auxDetail,
boolean&nbsp;all)</pre>
<div class="block">Human readable summary with optional detail</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>summary</code> - if true, output the sketch summary</dd>
<dd><code>hllDetail</code> - if true, output the internal data array</dd>
<dd><code>auxDetail</code> - if true, output the internal Aux array, if it exists.</dd>
<dd><code>all</code> - if true, outputs all entries including empty ones</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>human readable string with optional detail.</dd>
</dl>
</li>
</ul>
<a name="update-com.yahoo.sketches.hll.HllSketch-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(<a href="../../../../com/yahoo/sketches/hll/HllSketch.html" title="class in com.yahoo.sketches.hll">HllSketch</a>&nbsp;sketch)</pre>
<div class="block">Update this union operator with the given sketch.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sketch</code> - the given sketch.</dd>
</dl>
</li>
</ul>
<a name="getSerializationVersion--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSerializationVersion</h4>
<pre>public static final&nbsp;int&nbsp;getSerializationVersion()</pre>
<div class="block">Returns the current serialization version.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current serialization version.</dd>
</dl>
</li>
</ul>
<a name="getSerializationVersion-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSerializationVersion</h4>
<pre>public static final&nbsp;int&nbsp;getSerializationVersion(com.yahoo.memory.Memory&nbsp;mem)</pre>
<div class="block">Returns the current serialization version of the given Memory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mem</code> - the given Memory containing a serialized HllSketch image.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current serialization version.</dd>
</dl>
</li>
</ul>
<a name="getRelErr-boolean-boolean-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRelErr</h4>
<pre>public&nbsp;double&nbsp;getRelErr(boolean&nbsp;upperBound,
boolean&nbsp;unioned,
int&nbsp;lgConfigK,
int&nbsp;numStdDev)</pre>
<div class="block">Gets the current (approximate) Relative Error (RE) asymptotic values given several
parameters. This is used primarily for testing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>upperBound</code> - return the RE for the Upper Bound, otherwise for the Lower Bound.</dd>
<dd><code>unioned</code> - set true if the sketch is the result of a union operation.</dd>
<dd><code>lgConfigK</code> - the configured value for the sketch.</dd>
<dd><code>numStdDev</code> - the given number of Standard Deviations. This must be an integer between
1 and 3, inclusive.
<a href="../../../../resources/dictionary.html#numStdDev">Number of Standard Deviations</a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current (approximate) RelativeError</dd>
</dl>
</li>
</ul>
<a name="isEstimationMode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEstimationMode</h4>
<pre>public&nbsp;boolean&nbsp;isEstimationMode()</pre>
<div class="block">This HLL family of sketches and operators is always estimating, even for very small values.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<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;toString()</pre>
<div class="block">Human readable summary as a string.</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">toString</a></code>&nbsp;in class&nbsp;<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">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Human readable summary as a string.</dd>
</dl>
</li>
</ul>
<a name="toString-boolean-boolean-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<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;toString(boolean&nbsp;summary,
boolean&nbsp;detail,
boolean&nbsp;auxDetail)</pre>
<div class="block">Human readable summary with optional detail. Does not list empty entries.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>summary</code> - if true, output the sketch summary</dd>
<dd><code>detail</code> - if true, output the internal data array</dd>
<dd><code>auxDetail</code> - if true, output the internal Aux array, if it exists.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>human readable string with optional detail.</dd>
</dl>
</li>
</ul>
<a name="update-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(long&nbsp;datum)</pre>
<div class="block">Present the given long as a potential unique item.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>datum</code> - The given long datum.</dd>
</dl>
</li>
</ul>
<a name="update-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(double&nbsp;datum)</pre>
<div class="block">Present the given double (or float) datum as a potential unique item.
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>
</dl>
</li>
</ul>
<a name="update-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&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 the given String as a potential unique item.
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: About 2X faster performance can be obtained by first converting the String to a
char[] and updating the sketch with that. This bypasses the complexity of the Java UTF_8
encoding. This, of course, will not produce the same internal hash values as updating directly
with a String. So be consistent! Unioning two sketches, one fed with strings and the other
fed with char[] will be meaningless.
</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>datum</code> - The given String.</dd>
</dl>
</li>
</ul>
<a name="update-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(byte[]&nbsp;data)</pre>
<div class="block">Present the given byte array as a potential unique item.
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>
</dl>
</li>
</ul>
<a name="update-char:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(char[]&nbsp;data)</pre>
<div class="block">Present the given char array as a potential unique item.
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/hll/Union.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>
</dl>
</li>
</ul>
<a name="update-int:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(int[]&nbsp;data)</pre>
<div class="block">Present the given integer array as a potential unique item.
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>
</dl>
</li>
</ul>
<a name="update-long:A-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(long[]&nbsp;data)</pre>
<div class="block">Present the given long array as a potential unique item.
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>
</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/Union.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/hll/TgtHllType.html" title="enum in com.yahoo.sketches.hll"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/yahoo/sketches/hll/Union.html" target="_top">Frames</a></li>
<li><a href="Union.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><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 name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2018. All rights reserved.</small></p>
</body>
</html>