| <!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 Tue Dec 04 17:15:14 PST 2018 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Util (com.yahoo.datasketches:memory 0.12.1 API)</title> |
| <meta name="date" content="2018-12-04"> |
| <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="Util (com.yahoo.datasketches:memory 0.12.1 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static 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="../../../com/yahoo/memory/package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Util.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/memory/Utf8CodingException.html" title="class in com.yahoo.memory"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../com/yahoo/memory/Util.RandomCodePoints.html" title="class in com.yahoo.memory"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?com/yahoo/memory/Util.html" target="_top">Frames</a></li> |
| <li><a href="Util.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../allclasses-noframe.html">All 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: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">com.yahoo.memory</div> |
| <h2 title="Class Util" class="title">Class Util</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.memory.Util</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public final class <span class="typeNameLabel">Util</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> |
| <dl> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Lee Rhodes</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.RandomCodePoints.html" title="class in com.yahoo.memory">Util.RandomCodePoints</a></span></code> |
| <div class="block">Creates random valid Character Code Points (as integers).</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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#binarySearchLongs-com.yahoo.memory.Memory-long-long-long-">binarySearchLongs</a></span>(<a href="../../../com/yahoo/memory/Memory.html" title="class in com.yahoo.memory">Memory</a> mem, |
| long fromLongIndex, |
| long toLongIndex, |
| long key)</code> |
| <div class="block">Searches a range of the specified array of longs for the specified value using the binary |
| search algorithm.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#characterPad-java.lang.String-int-char-boolean-">characterPad</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> s, |
| int fieldLength, |
| char padChar, |
| boolean postpend)</code> |
| <div class="block">Prepend or postpend the given string with the given character to fill the given field length.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#isAllBitsClear-long-long-">isAllBitsClear</a></span>(long value, |
| long bitMask)</code> |
| <div class="block">Return true if all the masked bits of value are zero</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#isAllBitsSet-long-long-">isAllBitsSet</a></span>(long value, |
| long bitMask)</code> |
| <div class="block">Return true if all the masked bits of value are one</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#isAnyBitsClear-long-long-">isAnyBitsClear</a></span>(long value, |
| long bitMask)</code> |
| <div class="block">Return true if any the masked bits of value are zero</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#isAnyBitsSet-long-long-">isAnyBitsSet</a></span>(long value, |
| long bitMask)</code> |
| <div class="block">Return true if any the masked bits of value are one</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/Util.html#zeroPad-java.lang.String-int-">zeroPad</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> s, |
| int fieldLength)</code> |
| <div class="block">Prepend the given string with zeros.</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 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#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="binarySearchLongs-com.yahoo.memory.Memory-long-long-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>binarySearchLongs</h4> |
| <pre>public static long binarySearchLongs(<a href="../../../com/yahoo/memory/Memory.html" title="class in com.yahoo.memory">Memory</a> mem, |
| long fromLongIndex, |
| long toLongIndex, |
| long key)</pre> |
| <div class="block">Searches a range of the specified array of longs for the specified value using the binary |
| search algorithm. The range must be sorted method) prior to making this call. |
| If it is not sorted, the results are undefined. If the range contains |
| multiple elements with the specified value, there is no guarantee which one will be found.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>mem</code> - the Memory to be searched</dd> |
| <dd><code>fromLongIndex</code> - the index of the first element (inclusive) to be searched</dd> |
| <dd><code>toLongIndex</code> - the index of the last element (exclusive) to be searched</dd> |
| <dd><code>key</code> - the value to be searched for</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>index of the search key, if it is contained in the array within the specified range; |
| otherwise, (-(insertion point) - 1). The insertion point is defined as the point at which |
| the key would be inserted into the array: the index of the first element in the range greater |
| than the key, or toIndex if all elements in the range are less than the specified key. |
| Note that this guarantees that the return value will be ≥ 0 if and only if the key is found.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="zeroPad-java.lang.String-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>zeroPad</h4> |
| <pre>public static final <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> zeroPad(<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> s, |
| int fieldLength)</pre> |
| <div class="block">Prepend the given string with zeros. If the given string is equal or greater than the given |
| field length, it will be returned without modification.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the given string</dd> |
| <dd><code>fieldLength</code> - desired total field length including the given string</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the given string prepended with zeros.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="characterPad-java.lang.String-int-char-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>characterPad</h4> |
| <pre>public static final <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> characterPad(<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> s, |
| int fieldLength, |
| char padChar, |
| boolean postpend)</pre> |
| <div class="block">Prepend or postpend the given string with the given character to fill the given field length. |
| If the given string is equal or greater than the given field length, it will be returned |
| without modification.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>s</code> - the given string</dd> |
| <dd><code>fieldLength</code> - the desired field length</dd> |
| <dd><code>padChar</code> - the desired pad character</dd> |
| <dd><code>postpend</code> - if true append the pacCharacters to the end of the string.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>prepended or postpended given string with the given character to fill the given field |
| length.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isAllBitsClear-long-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAllBitsClear</h4> |
| <pre>public static final boolean isAllBitsClear(long value, |
| long bitMask)</pre> |
| <div class="block">Return true if all the masked bits of value are zero</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the value to be tested</dd> |
| <dd><code>bitMask</code> - defines the bits of interest</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if all the masked bits of value are zero</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isAllBitsSet-long-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAllBitsSet</h4> |
| <pre>public static final boolean isAllBitsSet(long value, |
| long bitMask)</pre> |
| <div class="block">Return true if all the masked bits of value are one</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the value to be tested</dd> |
| <dd><code>bitMask</code> - defines the bits of interest</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if all the masked bits of value are one</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isAnyBitsClear-long-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAnyBitsClear</h4> |
| <pre>public static final boolean isAnyBitsClear(long value, |
| long bitMask)</pre> |
| <div class="block">Return true if any the masked bits of value are zero</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the value to be tested</dd> |
| <dd><code>bitMask</code> - defines the bits of interest</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if any the masked bits of value are zero</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isAnyBitsSet-long-long-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>isAnyBitsSet</h4> |
| <pre>public static final boolean isAnyBitsSet(long value, |
| long bitMask)</pre> |
| <div class="block">Return true if any the masked bits of value are one</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>value</code> - the value to be tested</dd> |
| <dd><code>bitMask</code> - defines the bits of interest</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>true if any the masked bits of value are one</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="../../../com/yahoo/memory/package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Util.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/memory/Utf8CodingException.html" title="class in com.yahoo.memory"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../com/yahoo/memory/Util.RandomCodePoints.html" title="class in com.yahoo.memory"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../index.html?com/yahoo/memory/Util.html" target="_top">Frames</a></li> |
| <li><a href="Util.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2015–2018 <a href="https://www.yahoo.com">Yahoo! Inc.</a>. All rights reserved.</small></p> |
| </body> |
| </html> |