blob: dce5d6d02660c6ef8e42b69f992d1c7fb4b89f46 [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_121) on Wed Mar 29 17:33:16 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>MemoryRequest (com.yahoo.datasketches:memory 0.9.1-SNAPSHOT API)</title>
<meta name="date" content="2017-03-29">
<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="MemoryRequest (com.yahoo.datasketches:memory 0.9.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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="../../../com/yahoo/memory/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MemoryRequest.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/MemoryRegion.html" title="class in com.yahoo.memory"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/yahoo/memory/MemoryUtil.html" title="class in com.yahoo.memory"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/yahoo/memory/MemoryRequest.html" target="_top">Frames</a></li>
<li><a href="MemoryRequest.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.yahoo.memory</div>
<h2 title="Interface MemoryRequest" class="title">Interface MemoryRequest</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">MemoryRequest</span></pre>
<div class="block">The MemoryRequest is a callback interface that is accessible from the Memory interface and
provides a means for a Memory object to request more memory from the calling class and to
free Memory that is no longer needed.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Lee Rhodes</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/MemoryRequest.html#free-com.yahoo.memory.Memory-">free</a></span>(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;mem)</code>
<div class="block">The given Memory with its capacity is to be freed.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/MemoryRequest.html#free-com.yahoo.memory.Memory-com.yahoo.memory.Memory-">free</a></span>(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;memToFree,
<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;newMem)</code>
<div class="block">The given memToFree with its capacity may be freed by the implementation.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/MemoryRequest.html#request-long-">request</a></span>(long&nbsp;capacityBytes)</code>
<div class="block">Request new Memory with the given capacity.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/yahoo/memory/MemoryRequest.html#request-com.yahoo.memory.Memory-long-long-">request</a></span>(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;origMem,
long&nbsp;copyToBytes,
long&nbsp;capacityBytes)</code>
<div class="block">Request for allocate and copy.</div>
</td>
</tr>
</table>
</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="request-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>request</h4>
<pre><a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;request(long&nbsp;capacityBytes)</pre>
<div class="block">Request new Memory with the given capacity.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>capacityBytes</code> - The capacity being requested</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>new Memory with the given capacity. If this request is refused it will be null.</dd>
</dl>
</li>
</ul>
<a name="request-com.yahoo.memory.Memory-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>request</h4>
<pre><a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;request(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;origMem,
long&nbsp;copyToBytes,
long&nbsp;capacityBytes)</pre>
<div class="block">Request for allocate and copy.
<p>Request to allocate new Memory with the capacityBytes; copy the contents of origMem from
zero to copyToBytes.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>origMem</code> - The original Memory, a portion, starting at zero, which will be copied to the
newly allocated Memory. This reference must not be null.
This origMem must not modified in any way, and may be reused or freed by the implementation.
The requesting application may NOT assume anything about the origMem.</dd>
<dd><code>copyToBytes</code> - the upper limit of the region to be copied from origMem to the newly
allocated memory. The upper region of the new Memory may or may not be cleared depending
on the implementation.</dd>
<dd><code>capacityBytes</code> - the desired new capacity of the newly allocated memory in bytes.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The new Memory with the given capacity. If this request is refused it will be null.</dd>
</dl>
</li>
</ul>
<a name="free-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>free</h4>
<pre>void&nbsp;free(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;mem)</pre>
<div class="block">The given Memory with its capacity is to be freed. It is assumed that the implementation of
this interface knows the type of Memory that was created and how to free it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mem</code> - The Memory to be freed</dd>
</dl>
</li>
</ul>
<a name="free-com.yahoo.memory.Memory-com.yahoo.memory.Memory-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>free</h4>
<pre>void&nbsp;free(<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;memToFree,
<a href="../../../com/yahoo/memory/Memory.html" title="interface in com.yahoo.memory">Memory</a>&nbsp;newMem)</pre>
<div class="block">The given memToFree with its capacity may be freed by the implementation.
Providing a reference to newMem enables the implementation to link the memToFree to the
newMem, if desired.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>memToFree</code> - the Memory to be freed. It is assumed that the implementation of
this interface knows the type of Memory that was created and how to free it, if desired.</dd>
<dd><code>newMem</code> - Providing a reference to newMem enables the implementation to link the memToFree to the
newMem, if desired.</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="../../../com/yahoo/memory/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/MemoryRequest.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/MemoryRegion.html" title="class in com.yahoo.memory"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/yahoo/memory/MemoryUtil.html" title="class in com.yahoo.memory"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/yahoo/memory/MemoryRequest.html" target="_top">Frames</a></li>
<li><a href="MemoryRequest.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2017 <a href="https://www.yahoo.com">Yahoo! Inc.</a>. All rights reserved.</small></p>
</body>
</html>