| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.18) on Wed Mar 01 02:01:42 GMT 2023 --> |
| <title>ByteAmount (Heron Java API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2023-03-01"> |
| <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="ByteAmount (Heron Java API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":9,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.heron.common.basics</a></div> |
| <h2 title="Class ByteAmount" class="title">Class ByteAmount</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">org.apache.heron.common.basics.ResourceMeasure</a><java.lang.Long></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.heron.common.basics.ByteAmount</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code>java.lang.Comparable<<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long>></code></dd> |
| </dl> |
| <hr> |
| <pre>public final class <span class="typeNameLabel">ByteAmount</span> |
| extends <a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></pre> |
| <div class="block">Class that encapsulates number of bytes, with helpers to handle units properly.</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> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ZERO">ZERO</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="fields.inherited.from.class.org.apache.heron.common.basics.ResourceMeasure"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.apache.heron.common.basics.<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a></h3> |
| <code><a href="ResourceMeasure.html#value">value</a></code></li> |
| </ul> |
| </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"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asBytes()">asBytes</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Returns the number of bytes associated with the ByteValue.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asGigabytes()">asGigabytes</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the number of bytes to gigabytes, rounding if there is a remainder.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asKilobytes()">asKilobytes</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the number of bytes to kilobytes, rounding if there is a remainder.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>long</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#asMegabytes()">asMegabytes</a></span>()</code></th> |
| <td class="colLast"> |
| <div class="block">Converts the number of bytes to megabytes, rounding if there is a remainder.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#divide(int)">divide</a></span>​(int factor)</code></th> |
| <td class="colLast"> |
| <div class="block">Divides by factor, rounding any remainder.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromBytes(long)">fromBytes</a></span>​(long bytes)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a ByteAmount value in bytes.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromGigabytes(long)">fromGigabytes</a></span>​(long gigabytes)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a ByteAmount value in gigabytes.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#fromMegabytes(long)">fromMegabytes</a></span>​(long megabytes)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a ByteAmount value in megabytes.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#increaseBy(int)">increaseBy</a></span>​(int percentage)</code></th> |
| <td class="colLast"> |
| <div class="block">Increases by a percentage, rounding any remainder.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#max(org.apache.heron.common.basics.ByteAmount)">max</a></span>​(<a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> other)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#minus(org.apache.heron.common.basics.ResourceMeasure)">minus</a></span>​(<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long> other)</code></th> |
| <td class="colLast"> |
| <div class="block">Subtracts other from this.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#multiply(int)">multiply</a></span>​(int factor)</code></th> |
| <td class="colLast"> |
| <div class="block">Multiplies by factor</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code><a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#plus(org.apache.heron.common.basics.ResourceMeasure)">plus</a></span>​(<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long> other)</code></th> |
| <td class="colLast"> |
| <div class="block">Adds other to this.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>java.lang.String</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.org.apache.heron.common.basics.ResourceMeasure"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.heron.common.basics.<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a></h3> |
| <code><a href="ResourceMeasure.html#compareTo(org.apache.heron.common.basics.ResourceMeasure)">compareTo</a>, <a href="ResourceMeasure.html#equals(java.lang.Object)">equals</a>, <a href="ResourceMeasure.html#getValue()">getValue</a>, <a href="ResourceMeasure.html#greaterOrEqual(org.apache.heron.common.basics.ResourceMeasure)">greaterOrEqual</a>, <a href="ResourceMeasure.html#greaterThan(org.apache.heron.common.basics.ResourceMeasure)">greaterThan</a>, <a href="ResourceMeasure.html#hashCode()">hashCode</a>, <a href="ResourceMeasure.html#isZero()">isZero</a>, <a href="ResourceMeasure.html#lessOrEqual(org.apache.heron.common.basics.ResourceMeasure)">lessOrEqual</a>, <a href="ResourceMeasure.html#lessThan(org.apache.heron.common.basics.ResourceMeasure)">lessThan</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 java.lang.Object</h3> |
| <code>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="ZERO"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>ZERO</h4> |
| <pre>public static final <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> ZERO</pre> |
| </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="fromBytes(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fromBytes</h4> |
| <pre class="methodSignature">public static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> fromBytes​(long bytes)</pre> |
| <div class="block">Creates a ByteAmount value in bytes.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>bytes</code> - value in bytes to represent</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a ByteAmount object repressing the number of bytes passed</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fromMegabytes(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fromMegabytes</h4> |
| <pre class="methodSignature">public static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> fromMegabytes​(long megabytes)</pre> |
| <div class="block">Creates a ByteAmount value in megabytes. If the megabytes value |
| is $lt;= Long.MAX_VALUE / 1024 / 1024, the byte representation is capped at Long.MAX_VALUE.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>megabytes</code> - value in megabytes to represent</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a ByteAmount object repressing the number of MBs passed</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="fromGigabytes(long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>fromGigabytes</h4> |
| <pre class="methodSignature">public static <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> fromGigabytes​(long gigabytes)</pre> |
| <div class="block">Creates a ByteAmount value in gigabytes. If the gigabytes value |
| is >= Long.MAX_VALUE / 1024 / 1024 / 1024, |
| the byte representation is capped at Long.MAX_VALUE.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>gigabytes</code> - value in gigabytes to represent</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a ByteAmount object repressing the number of GBs passed</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="asBytes()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asBytes</h4> |
| <pre class="methodSignature">public long asBytes()</pre> |
| <div class="block">Returns the number of bytes associated with the ByteValue.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>number of bytes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="asMegabytes()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asMegabytes</h4> |
| <pre class="methodSignature">public long asMegabytes()</pre> |
| <div class="block">Converts the number of bytes to megabytes, rounding if there is a remainder. Because of loss |
| of precision due to rounding, it's strongly advised to only use this method when it is certain |
| that the only operations performed on the object were multiplication or addition and |
| subtraction of other megabytes. If division or increaseBy were used this method could round up |
| or down, potentially yielding unexpected results.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>returns the ByteValue in MBs or 0 if the value is < (1024 * 1024) / 2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="asKilobytes()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asKilobytes</h4> |
| <pre class="methodSignature">public long asKilobytes()</pre> |
| <div class="block">Converts the number of bytes to kilobytes, rounding if there is a remainder. Because of loss |
| of precision due to rounding, it's strongly advised to only use this method when it is certain |
| that the only operations performed on the object were multiplication or addition and |
| subtraction of other megabytes. If division or increaseBy were used this method could round up |
| or down, potentially yielding unexpected results.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>returns the ByteValue in KBs or 0 if the value is < (1024) / 2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="asGigabytes()"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>asGigabytes</h4> |
| <pre class="methodSignature">public long asGigabytes()</pre> |
| <div class="block">Converts the number of bytes to gigabytes, rounding if there is a remainder. Because of loss |
| of precision due to rounding, it's strongly advised to only use this method when it is certain |
| that the only operations performed on the object were multiplication or addition and |
| subtraction of other gigabytes. If division or increaseBy were used this method could round up |
| or down, potentially yielding unexpected results.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>returns the ByteValue in GBs or 0 if the value is < (1024 * 1024 * 1024) / 2</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="minus(org.apache.heron.common.basics.ResourceMeasure)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>minus</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> minus​(<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long> other)</pre> |
| <div class="block">Subtracts other from this.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="ResourceMeasure.html#minus(org.apache.heron.common.basics.ResourceMeasure)">minus</a></code> in class <code><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>other</code> - ByteValue to subtract</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new ByteValue of this minus other ByteValue</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if subtraction would overshoot Long.MIN_VALUE</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="plus(org.apache.heron.common.basics.ResourceMeasure)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>plus</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> plus​(<a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long> other)</pre> |
| <div class="block">Adds other to this.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="ResourceMeasure.html#plus(org.apache.heron.common.basics.ResourceMeasure)">plus</a></code> in class <code><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>other</code> - ByteValue to add</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new ByteValue of this plus other ByteValue</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if addition would exceed Long.MAX_VALUE</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="multiply(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>multiply</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> multiply​(int factor)</pre> |
| <div class="block">Multiplies by factor</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="ResourceMeasure.html#multiply(int)">multiply</a></code> in class <code><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>factor</code> - value to multiply by</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new ByteValue of this ByteValue multiplied by factor</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if multiplication would exceed Long.MAX_VALUE</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="divide(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>divide</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> divide​(int factor)</pre> |
| <div class="block">Divides by factor, rounding any remainder. For example 10 bytes / 6 = 1.66 becomes 2. Use |
| caution when dividing and be aware that because of precision lose due to round-off, dividing by |
| X and multiplying back by X might not return the initial value.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="ResourceMeasure.html#divide(int)">divide</a></code> in class <code><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>factor</code> - value to divide by</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new ByteValue of this ByteValue divided by factor</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="increaseBy(int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>increaseBy</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> increaseBy​(int percentage)</pre> |
| <div class="block">Increases by a percentage, rounding any remainder. Be aware that because of rounding, increases |
| will be approximate to the nearest byte.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="ResourceMeasure.html#increaseBy(int)">increaseBy</a></code> in class <code><a href="ResourceMeasure.html" title="class in org.apache.heron.common.basics">ResourceMeasure</a><java.lang.Long></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>percentage</code> - value to increase by</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>a new ByteValue of this ByteValue increased by percentage</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalArgumentException</code> - if increase would exceed Long.MAX_VALUE</dd> |
| </dl> |
| </li> |
| </ul> |
| <a id="max(org.apache.heron.common.basics.ByteAmount)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>max</h4> |
| <pre class="methodSignature">public <a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> max​(<a href="ByteAmount.html" title="class in org.apache.heron.common.basics">ByteAmount</a> other)</pre> |
| </li> |
| </ul> |
| <a id="toString()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre class="methodSignature">public java.lang.String toString()</pre> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code>toString</code> in class <code>java.lang.Object</code></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="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| </footer> |
| </body> |
| </html> |