stasis/je-7.5.11/docs/java/com/sleepycat/je/DatabaseEntry.html

909 lines
37 KiB
HTML
Raw Normal View History

2019-06-25 20:12:40 +00:00
<!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_151) on Tue Oct 31 17:36:45 EDT 2017 -->
<title>DatabaseEntry (Oracle - Berkeley DB Java Edition API)</title>
<meta name="date" content="2017-10-31">
<link rel="stylesheet" type="text/css" href="../../../style.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="DatabaseEntry (Oracle - Berkeley DB Java Edition API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10};
var tabs = {65535:["t0","All 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/DatabaseEntry.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 class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/je/DatabaseEntry.html" target="_top">Frames</a></li>
<li><a href="DatabaseEntry.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.sleepycat.je</div>
<h2 title="Class DatabaseEntry" class="title">Class DatabaseEntry</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.sleepycat.je.DatabaseEntry</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">DatabaseEntry</span>
extends java.lang.Object
implements java.io.Serializable</pre>
<div class="block">Encodes database key and data items as a byte array.
<p>Storage and retrieval for the <a href="../../../com/sleepycat/je/Database.html" title="class in com.sleepycat.je"><code>Database</code></a>
and <a href="../../../com/sleepycat/je/Cursor.html" title="class in com.sleepycat.je"><code>Cursor</code></a> methods are based on key/data
pairs. Both key and data items are represented by DatabaseEntry objects.
Key and data byte arrays may refer to arrays of zero length up to arrays of
essentially unlimited length.</p>
<p>The DatabaseEntry class provides simple access to an underlying object
whose elements can be examined or changed. DatabaseEntry objects can be
subclassed, providing a way to associate with it additional data or
references to other structures.</p>
<p>Access to DatabaseEntry objects is not re-entrant. In particular, if
multiple threads simultaneously access the same DatabaseEntry object using
<a href="../../../com/sleepycat/je/Database.html" title="class in com.sleepycat.je"><code>Database</code></a> or <a href="../../../com/sleepycat/je/Cursor.html" title="class in com.sleepycat.je"><code>Cursor</code></a> methods, the results are undefined.</p>
<p>DatabaseEntry objects may be used in conjunction with the object mapping
support provided in the <a href="../../../com/sleepycat/bind/package-summary.html"><code>com.sleepycat.bind</code></a> package.</p>
<h3><a name="params">Input and Output Parameters</a></h3>
<p>DatabaseEntry objects are used for both input values (for example, when
writing to a database or specifying a search parameter) and output values
(for example, when reading from a database). For every CRUD method
(<code>get</code>, <code>put</code>, etc), each of the method's DatabaseEntry
parameters (<code>key</code>, <code>data</code>, etc) may be input or output
parameters, and this is specified by the method's documentation.</p>
<h4><a name="inParam">Input Parameters</a></h4>
<p>An input parameter is required by the JE method. The parameter may not be
null, and the caller is also responsible for initializing the data of the
DatabaseEntry to a non-null byte array.</p>
<p>Input parameters normally may not be <a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>partial</code></a>. However, this is allowed under certain circumstances, namely
the <a href="../../../com/sleepycat/je/Cursor.html#putCurrent-com.sleepycat.je.DatabaseEntry-"><code>Cursor.putCurrent(com.sleepycat.je.DatabaseEntry)</code></a> method allows specifying a partial data
parameter in order to update only part of the record's data value. Input
parameters are NOT allowed to be partial unless this is explicitly stated in
the method documentation.</p>
<p>Although an input parameter is always used for input, in some cases it
may be also used for output. For example, the <a href="../../../com/sleepycat/je/Cursor.html#getSearchKeyRange-com.sleepycat.je.DatabaseEntry-com.sleepycat.je.DatabaseEntry-com.sleepycat.je.LockMode-"><code>Cursor.getSearchKeyRange(com.sleepycat.je.DatabaseEntry, com.sleepycat.je.DatabaseEntry, com.sleepycat.je.LockMode)</code></a> method is passed a key parameter that is used as
input, but since a record with a different key (greater or equal to the key
given) may be found, the key parameter is also used to return the key
that was found. Such parameters are documented as "input/output"
parameters.</p>
<p>Another example is when a custom key comparator is used and a key
parameter is passed to a search method. The input parameter may match a
record's key even if the bytes are not equal, and the key of the record
found will be returned via the parameter. The same thing is true of data (or
primary key) parameters when a custom duplicate comparator is used. Because
of this, all input parameters of "get" methods can potentially be used for
output, however, they are not explicitly documented to be input/output
parameters.</p>
<h4><a name="outParam">Output Parameters</a></h4>
<p>An output parameter is not required by the JE method. It is used to
optionally return a value to the caller. Null may be passed for the
parameter if no returned value is needed. Passing null is a common way to
optimize read operations when only the record's key, and not the record's
data, is required. By passing null for the data parameter, a read from
disk can be avoided when the data is not already cached. In addition, all
output parameters may be <a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>partial</code></a> to
allow only returning a part of the data byte array. See <a
href="Cursor.html#partialEntry">Using Null and Partial DatabaseEntry
Parameters</a> for more information.</p>
<p>For output parameters, the byte array specified by the caller will not be
used and may be null. The JE method will will always allocate a new byte
array. Therefore, after calling a method that returns output parameters,
the application can safely keep a reference to the byte array returned by
<a href="../../../com/sleepycat/je/DatabaseEntry.html#getData--"><code>getData()</code></a> without danger that the array will be overwritten in a
subsequent call.</p>
<p>Historical note: Prior to JE 7.0, null could not be passed for output
parameters. Instead, <code>DatabaseEntry.setPartial(0, 0, true)</code> was called
for a data parameter to avoid reading the record's data. Now, null can be
passed instead.</p>
<h3>Offset and Size Properties</h3>
<p>By default the Offset property is zero and the Size property is the
length of the byte array. However, to allow for optimizations involving the
partial use of a byte array, the Offset and Size may be set to non-default
values.</p>
<p>For output parameters, the Size will always be set to the length of the
byte array and the Offset will always be set to zero.</p>
<p>However, for input parameters the Offset and Size are set to non-default
values by the built-in tuple and serial bindings. For example, with a tuple
or serial binding the byte array is grown dynamically as data is output, and
the Size is set to the number of bytes actually used. For a serial binding,
the Offset is set to a non-zero value in order to implement an optimization
having to do with the serialization stream header.</p>
<p>WARNING: In callbacks that are passed DatabaseEntry parameters, the
application should always honor the Size and Offset properties, rather than
assuming they have default values.</p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../serialized-form.html#com.sleepycat.je.DatabaseEntry">Serialized Form</a></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/sleepycat/je/DatabaseEntry.html#DatabaseEntry--">DatabaseEntry</a></span>()</code>
<div class="block">Constructs a DatabaseEntry with null data.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#DatabaseEntry-byte:A-">DatabaseEntry</a></span>(byte[]&nbsp;data)</code>
<div class="block">Constructs a DatabaseEntry with a given byte array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#DatabaseEntry-byte:A-int-int-">DatabaseEntry</a></span>(byte[]&nbsp;data,
int&nbsp;offset,
int&nbsp;size)</code>
<div class="block">Constructs a DatabaseEntry with a given byte array, offset and size.</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="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>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object&nbsp;o)</code>
<div class="block">Compares the data of two entries for byte-by-byte equality.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getData--">getData</a></span>()</code>
<div class="block">Returns the byte array.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getOffset--">getOffset</a></span>()</code>
<div class="block">Returns the byte offset into the data array.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getPartial--">getPartial</a></span>()</code>
<div class="block">Returns whether this DatabaseEntry is configured to read or write
partial records.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getPartialLength--">getPartialLength</a></span>()</code>
<div class="block">Returns the byte length of the partial record being read or written by
the application, in bytes.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getPartialOffset--">getPartialOffset</a></span>()</code>
<div class="block">Returns the offset of the partial record being read or written by the
application, in bytes.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#getSize--">getSize</a></span>()</code>
<div class="block">Returns the byte size of the data array.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#hashCode--">hashCode</a></span>()</code>
<div class="block">Returns a hash code based on the data value.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setData-byte:A-">setData</a></span>(byte[]&nbsp;data)</code>
<div class="block">Sets the byte array.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setData-byte:A-int-int-">setData</a></span>(byte[]&nbsp;data,
int&nbsp;offset,
int&nbsp;size)</code>
<div class="block">Sets the byte array, offset and size.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setOffset-int-">setOffset</a></span>(int&nbsp;offset)</code>
<div class="block">Sets the byte offset into the data array.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-boolean-">setPartial</a></span>(boolean&nbsp;partial)</code>
<div class="block">Configures this DatabaseEntry to read or write partial records.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-">setPartial</a></span>(int&nbsp;doff,
int&nbsp;dlen,
boolean&nbsp;partial)</code>
<div class="block">Configures this DatabaseEntry to read or write partial records.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartialLength-int-">setPartialLength</a></span>(int&nbsp;dlen)</code>
<div class="block">Sets the byte length of the partial record being read or written by the
application, in bytes.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartialOffset-int-">setPartialOffset</a></span>(int&nbsp;doff)</code>
<div class="block">Sets the offset of the partial record being read or written by the
application, in bytes.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#setSize-int-">setSize</a></span>(int&nbsp;size)</code>
<div class="block">Sets the byte size of the data array.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/DatabaseEntry.html#toString--">toString</a></span>()</code>
<div class="block">Returns all the attributes of the database entry in text form, including
the underlying 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.Object</h3>
<code>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</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="DatabaseEntry--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DatabaseEntry</h4>
<pre>public&nbsp;DatabaseEntry()</pre>
<div class="block">Constructs a DatabaseEntry with null data. The offset and size are set
to zero.</div>
</li>
</ul>
<a name="DatabaseEntry-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DatabaseEntry</h4>
<pre>public&nbsp;DatabaseEntry(byte[]&nbsp;data)</pre>
<div class="block">Constructs a DatabaseEntry with a given byte array. The offset is set
to zero; the size is set to the length of the array, or to zero if null
is passed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - Byte array wrapped by the DatabaseEntry.</dd>
</dl>
</li>
</ul>
<a name="DatabaseEntry-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DatabaseEntry</h4>
<pre>public&nbsp;DatabaseEntry(byte[]&nbsp;data,
int&nbsp;offset,
int&nbsp;size)</pre>
<div class="block">Constructs a DatabaseEntry with a given byte array, offset and size.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - Byte array wrapped by the DatabaseEntry.</dd>
<dd><code>offset</code> - Offset in the first byte in the byte array to be included.</dd>
<dd><code>size</code> - Number of bytes in the byte array to be included.</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="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<div class="block">Returns all the attributes of the database entry in text form, including
the underlying data. The maximum number of bytes that will be formatted
is taken from the static variable DatabaseEntry.MAX_DUMP_BYTES, which
defaults to 100. MAX_DUMP_BYTES may be changed by an application if it
wishes to cause more bytes to be formatted.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="getData--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getData</h4>
<pre>public&nbsp;byte[]&nbsp;getData()</pre>
<div class="block">Returns the byte array.
<p>For a DatabaseEntry that is used as an output parameter, the byte
array will always be a newly allocated array. The byte array specified
by the caller will not be used and may be null.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The byte array.</dd>
</dl>
</li>
</ul>
<a name="setData-byte:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setData</h4>
<pre>public&nbsp;void&nbsp;setData(byte[]&nbsp;data)</pre>
<div class="block">Sets the byte array. The offset is set to zero; the size is set to the
length of the array, or to zero if null is passed.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - Byte array wrapped by the DatabaseEntry.</dd>
</dl>
</li>
</ul>
<a name="setData-byte:A-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setData</h4>
<pre>public&nbsp;void&nbsp;setData(byte[]&nbsp;data,
int&nbsp;offset,
int&nbsp;size)</pre>
<div class="block">Sets the byte array, offset and size.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>data</code> - Byte array wrapped by the DatabaseEntry.</dd>
<dd><code>offset</code> - Offset in the first byte in the byte array to be included.</dd>
<dd><code>size</code> - Number of bytes in the byte array to be included.</dd>
</dl>
</li>
</ul>
<a name="setPartial-int-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPartial</h4>
<pre>public&nbsp;void&nbsp;setPartial(int&nbsp;doff,
int&nbsp;dlen,
boolean&nbsp;partial)</pre>
<div class="block">Configures this DatabaseEntry to read or write partial records.
<p>By default the specified data (byte array, offset and size)
corresponds to the full stored key or data item. Optionally, the
Partial property can be set to true, and the PartialOffset and
PartialLength properties are used to specify the portion of the key or
data item to be read or written.</p>
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method, nor will they every be
set by bindings. Therefore, the application can assume that the Partial
properties are not set, unless the application itself sets them
explicitly.</p>
<p>All {<a href="#outParam>output parameters</a>} may be partial. If the
calling application is doing a retrieval, length bytes specified by
<tt>dlen</tt>, starting at the offset set by <tt>doff</tt> bytes from
the beginning of the retrieved data record are returned as if they
comprised the entire record. If any or all of the specified bytes do
not exist in the record, the get is successful, and any existing bytes
are returned.</p>
<p>For example, if the data portion of a retrieved record was 100 bytes,
and a partial retrieval was done using a DatabaseEntry having a partial
length of 20 and a partial offset of 85, the retrieval would succeed and
the retrieved data would be the last 15 bytes of the record.</p>
<p>Input parameters normally may not be <a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>partial</code></a>. However, this is allowed under
certain circumstances, namely the <a href="../../../com/sleepycat/je/Cursor.html#putCurrent-com.sleepycat.je.DatabaseEntry-"><code>Cursor.putCurrent(com.sleepycat.je.DatabaseEntry)</code></a> method
allows specifying a partial data parameter in order to update only part
of the record's data value. Input parameters are NOT allowed to be
partial unless this is explicitly stated in the method
documentation.</p>
<p>For storing an item using a partial parameter, length bytes specified
by <tt>dlen</tt>, starting at the offset set by <tt>doff</tt> bytes from
the beginning of the specified key's data item are replaced by the data
specified by the DatabaseEntry. If the partial length is smaller than
the data, the record will grow; if the partial length is larger than the
data, the record will shrink. If the partial offset is greater than the
length of the data, the record will be extended using zero bytes as
necessary, and the store will succeed.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>doff</code> - The offset of the partial record being read or written by
the application, in bytes.</dd>
<dd><code>dlen</code> - The byte length of the partial record being read or written
by the application, in bytes.</dd>
<dd><code>partial</code> - Whether this DatabaseEntry is configured to read or write
partial records.</dd>
</dl>
</li>
</ul>
<a name="getPartialLength--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartialLength</h4>
<pre>public&nbsp;int&nbsp;getPartialLength()</pre>
<div class="block">Returns the byte length of the partial record being read or written by
the application, in bytes.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The byte length of the partial record being read or written by
the application, in bytes.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="setPartialLength-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPartialLength</h4>
<pre>public&nbsp;void&nbsp;setPartialLength(int&nbsp;dlen)</pre>
<div class="block">Sets the byte length of the partial record being read or written by the
application, in bytes.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dlen</code> - The byte length of the partial record being read or written
by the</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="getPartialOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartialOffset</h4>
<pre>public&nbsp;int&nbsp;getPartialOffset()</pre>
<div class="block">Returns the offset of the partial record being read or written by the
application, in bytes.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The offset of the partial record being read or written by the
application, in bytes.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="setPartialOffset-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPartialOffset</h4>
<pre>public&nbsp;void&nbsp;setPartialOffset(int&nbsp;doff)</pre>
<div class="block">Sets the offset of the partial record being read or written by the
application, in bytes.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>doff</code> - The offset of the partial record being read or written by
the application, in bytes.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="getPartial--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPartial</h4>
<pre>public&nbsp;boolean&nbsp;getPartial()</pre>
<div class="block">Returns whether this DatabaseEntry is configured to read or write
partial records.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether this DatabaseEntry is configured to read or write
partial records.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="setPartial-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPartial</h4>
<pre>public&nbsp;void&nbsp;setPartial(boolean&nbsp;partial)</pre>
<div class="block">Configures this DatabaseEntry to read or write partial records.
<p>Note that the Partial properties are set only by the caller. They
will never be set by a Database or Cursor method.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>partial</code> - Whether this DatabaseEntry is configured to read or write
partial records.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../com/sleepycat/je/DatabaseEntry.html#setPartial-int-int-boolean-"><code>setPartial(int,int,boolean)</code></a></dd>
</dl>
</li>
</ul>
<a name="getOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOffset</h4>
<pre>public&nbsp;int&nbsp;getOffset()</pre>
<div class="block">Returns the byte offset into the data array.
<p>For a DatabaseEntry that is used as an output parameter, the offset
will always be zero.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Offset in the first byte in the byte array to be included.</dd>
</dl>
</li>
</ul>
<a name="setOffset-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOffset</h4>
<pre>public&nbsp;void&nbsp;setOffset(int&nbsp;offset)</pre>
<div class="block">Sets the byte offset into the data array.
ArrayIndexOutOfBoundsException if the data, offset, and size parameters
refer to elements of the data array which do not exist. Note that this
exception will not be thrown by setSize() or setOffset(), but will be
thrown by varous JE methods if "this" is inconsistent and is used as an
input parameter to those methods. It is the caller's responsibility to
ensure that size, offset, and data.length are consistent.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>offset</code> - Offset in the first byte in the byte array to be included.</dd>
</dl>
</li>
</ul>
<a name="getSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSize</h4>
<pre>public&nbsp;int&nbsp;getSize()</pre>
<div class="block">Returns the byte size of the data array.
<p>For a DatabaseEntry that is used as an output parameter, the size
will always be the length of the data array.</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Number of bytes in the byte array to be included.</dd>
</dl>
</li>
</ul>
<a name="setSize-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSize</h4>
<pre>public&nbsp;void&nbsp;setSize(int&nbsp;size)</pre>
<div class="block">Sets the byte size of the data array.
ArrayIndexOutOfBoundsException if the data, offset, and size parameters
refer to elements of the data array which do not exist. Note that this
exception will not be thrown by setSize() or setOffset(), but will be
thrown by varous JE methods if "this" is inconsistent and is used as an
input parameter to those methods. It is the caller's responsibility to
ensure that size, offset, and data.length are consistent.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>size</code> - Number of bytes in the byte array to be included.</dd>
</dl>
</li>
</ul>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals(java.lang.Object&nbsp;o)</pre>
<div class="block">Compares the data of two entries for byte-by-byte equality.
<p>In either entry, if the offset is non-zero or the size is not equal
to the data array length, then only the data bounded by these values is
compared. The data array length and offset need not be the same in both
entries for them to be considered equal.</p>
<p>If the data array is null in one entry, then to be considered equal
both entries must have a null data array.</p>
<p>If the partial property is set in either entry, then to be considered
equal both entries must have the same partial properties: partial,
partialOffset and partialLength.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>equals</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<div class="block">Returns a hash code based on the data value.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>hashCode</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></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/DatabaseEntry.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 class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/je/DatabaseConfig.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/je/DatabaseEntry.html" target="_top">Frames</a></li>
<li><a href="DatabaseEntry.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><font size=1>Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
</body>
</html>