Debian Codegraph @

docs/java/com/sleepycat/db/DatabaseEntry.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <!--NewPage-->
3 <HTML>
4 <HEAD>
5 <!-- Generated by javadoc (build 1.6.0_51) on Mon Sep 09 11:47:04 EDT 2013 -->
6 <TITLE>
7 DatabaseEntry (Oracle - Berkeley DB Java API)
8 </TITLE>
9
10 <META NAME="date" CONTENT="2013-09-09">
11
12 <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../style.css" TITLE="Style">
13
14 <SCRIPT type="text/javascript">
15 function windowTitle()
16 {
17 if (location.href.indexOf('is-external=true') == -1) {
18 parent.document.title="DatabaseEntry (Oracle - Berkeley DB Java API)";
19 }
20 }
21 </SCRIPT>
22 <NOSCRIPT>
23 </NOSCRIPT>
24
25 </HEAD>
26
27 <BODY BGCOLOR="white" onload="windowTitle();">
28 <HR>
29
30
31 <!-- ========= START OF TOP NAVBAR ======= -->
32 <A NAME="navbar_top"><!-- --></A>
33 <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
34 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
35 <TR>
36 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
37 <A NAME="navbar_top_firstrow"><!-- --></A>
38 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
39 <TR ALIGN="center" VALIGN="top">
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DatabaseEntry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
44 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
45 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
46 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
47 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48 </TR>
49 </TABLE>
50 </TD>
51 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52 <b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
53 </TD>
54 </TR>
55
56 <TR>
57 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58 &nbsp;<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
59 &nbsp;<A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
60 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61 <A HREF="../../../index.html?com/sleepycat/db/DatabaseEntry.html" target="_top"><B>FRAMES</B></A> &nbsp;
62 &nbsp;<A HREF="DatabaseEntry.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
63 &nbsp;<SCRIPT type="text/javascript">
64 <!--
65 if(window==top) {
66 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
67 }
68 //-->
69 </SCRIPT>
70 <NOSCRIPT>
71 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
72 </NOSCRIPT>
73
74
75 </FONT></TD>
76 </TR>
77 <TR>
78 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82 </TR>
83 </TABLE>
84 <A NAME="skip-navbar_top"></A>
85 <!-- ========= END OF TOP NAVBAR ========= -->
86
87 <HR>
88 <!-- ======== START OF CLASS DATA ======== -->
89 <H2>
90 <FONT SIZE="-1">
91 com.sleepycat.db</FONT>
92 <BR>
93 Class DatabaseEntry</H2>
94 <PRE>
95 <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.sleepycat.db.DatabaseEntry</B>
97 </PRE>
98 <DL>
99 <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/sleepycat/db/MultipleEntry.html" title="class in com.sleepycat.db">MultipleEntry</A></DD>
100 </DL>
101 <HR>
102 <DL>
103 <DT><PRE>public class <B>DatabaseEntry</B><DT>extends <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
104 </PRE>
105
106 <P>
107 Encodes database key and data items as a byte array.
108 <p>
109 Storage and retrieval for the <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> and <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> methods
110 are based on key/data pairs. Both key and data items are represented by
111 DatabaseEntry objects. Key and data byte arrays may refer to arrays of zero
112 length up to arrays of essentially unlimited length.
113 <p>
114 The DatabaseEntry class provides simple access to an underlying object whose
115 elements can be examined or changed. DatabaseEntry objects can be
116 subclassed, providing a way to associate with it additional data or
117 references to other structures.
118 <p>
119 Access to DatabaseEntry objects is not re-entrant. In particular, if
120 multiple threads simultaneously access the same DatabaseEntry object using
121 <A HREF="../../../com/sleepycat/db/Database.html" title="class in com.sleepycat.db"><CODE>Database</CODE></A> or <A HREF="../../../com/sleepycat/db/Cursor.html" title="class in com.sleepycat.db"><CODE>Cursor</CODE></A> methods, the results are undefined.
122 <p>
123 DatabaseEntry objects may be used in conjunction with the object mapping
124 support provided in the <A HREF="../../../com/sleepycat/bind/package-summary.html"><CODE>com.sleepycat.bind</CODE></A> package.
125 <p>
126 <h3>Input and Output Parameters</h3>
127 <p>
128 DatabaseEntry objects are used for both input data (when writing to a
129 database or specifying a search parameter) and output data (when reading
130 from a database). For certain methods, one parameter may be an input
131 parameter and another may be an output parameter. For example, the
132 <A HREF="../../../com/sleepycat/db/Database.html#get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)"><CODE>Database.get(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.LockMode)</CODE></A> method has an input key parameter and an output
133 data parameter. The documentation for each method describes whether its
134 parameters are input or output parameters.
135 <p>
136 For DatabaseEntry input parameters, the caller is responsible for
137 initializing the data array of the DatabaseEntry. For DatabaseEntry
138 output parameters, the method called will initialize the data array.
139 <p>
140 For DatabaseEntry output parameters, by default the method called will
141 reuse the byte array in the DatabaseEntry, if the data returned fits in
142 the byte array. This behavior can be configured with <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReuseBuffer(boolean)"><CODE>setReuseBuffer(boolean)</CODE></A> or <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)"><CODE>setUserBuffer(int, boolean)</CODE></A>. If an entry is configured to
143 reuse the byte array (the default behavior), the length of the underlying
144 byte array should not be used to determine the amount of data returned each
145 time the entry is used as an output parameter, rather the <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()"><CODE>getSize()</CODE></A>
146 call should be used. If an entry is configured to not reuse the byte array,
147 a new array is allocated each time the entry is used as an output parameter,
148 so
149 the application can safely keep a reference to the byte array returned
150 by <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getData()"><CODE>getData()</CODE></A> without danger that the array will be overwritten in
151 a subsequent call.
152 <p>
153 <h3>Offset and Size Properties</h3>
154 <p>
155 By default the Offset property is zero and the Size property is the length
156 of the byte array. However, to allow for optimizations involving the
157 partial use of a byte array, the Offset and Size may be set to non-default
158 values.
159 <p>
160 For DatabaseEntry output parameters, the Size will always be set to the
161 length of the returned data and
162 the Offset will always be set to zero.
163 <p>
164 However, for DatabaseEntry input parameters the Offset and Size are set to
165 non-default values by the built-in tuple and serial bindings. For example,
166 with a tuple or serial binding the byte array is grown dynamically as data
167 is output, and the Size is set to the number of bytes actually used. For a
168 serial binding, the Offset is set to a non-zero value in order to implement
169 an optimization having to do with the serialization stream header.
170 <p>
171 Therefore, for output DatabaseEntry parameters the application can assume
172 that the Offset is zero and the Size is the length of the byte array.
173 However, for input DatabaseEntry parameters the application should not make
174 this assumption. In general, it is safest for the application to always
175 honor the Size and Offset properties, rather than assuming they have default
176 values.
177 <p>
178 <h3>Partial Offset and Length Properties</h3>
179 <p>
180 By default the specified data (byte array, offset and size) corresponds to
181 the full stored key or data item. Optionally, the Partial property can be
182 set to true, and the PartialOffset and PartialLength properties are used to
183 specify the portion of the key or data item to be read or written. For
184 details, see the <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A> method.
185 <p>
186 Note that the Partial properties are set only by the caller. They will
187 never be set by a Database or Cursor method, nor will they every be set by
188 bindings. Therefore, the application can assume that the Partial properties
189 are not set, unless the application itself sets them explicitly.
190 <P>
191
192 <P>
193 <HR>
194
195 <P>
196
197 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
198
199 <A NAME="constructor_summary"><!-- --></A>
200 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
201 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
202 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
203 <B>Constructor Summary</B></FONT></TH>
204 </TR>
205 <TR BGCOLOR="white" CLASS="TableRowColor">
206 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry()">DatabaseEntry</A></B>()</CODE>
207
208 <BR>
209 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with null data.</TD>
210 </TR>
211 <TR BGCOLOR="white" CLASS="TableRowColor">
212 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(byte[])">DatabaseEntry</A></B>(byte[]&nbsp;data)</CODE>
213
214 <BR>
215 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with a given byte array.</TD>
216 </TR>
217 <TR BGCOLOR="white" CLASS="TableRowColor">
218 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(byte[], int, int)">DatabaseEntry</A></B>(byte[]&nbsp;data,
219 int&nbsp;offset,
220 int&nbsp;size)</CODE>
221
222 <BR>
223 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a DatabaseEntry with a given byte array, offset and size.</TD>
224 </TR>
225 <TR BGCOLOR="white" CLASS="TableRowColor">
226 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#DatabaseEntry(java.nio.ByteBuffer)">DatabaseEntry</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</CODE>
227
228 <BR>
229 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a DatabaseEntry with a given native I/O buffer.</TD>
230 </TR>
231 </TABLE>
232 &nbsp;
233 <!-- ========== METHOD SUMMARY =========== -->
234
235 <A NAME="method_summary"><!-- --></A>
236 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
237 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
238 <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
239 <B>Method Summary</B></FONT></TH>
240 </TR>
241 <TR BGCOLOR="white" CLASS="TableRowColor">
242 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
243 <CODE>&nbsp;boolean</CODE></FONT></TD>
244 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#equals(java.lang.Object)">equals</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</CODE>
245
246 <BR>
247 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compares the data of two entries for byte-by-byte equality.</TD>
248 </TR>
249 <TR BGCOLOR="white" CLASS="TableRowColor">
250 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
251 <CODE>&nbsp;byte[]</CODE></FONT></TD>
252 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getData()">getData</A></B>()</CODE>
253
254 <BR>
255 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte array.</TD>
256 </TR>
257 <TR BGCOLOR="white" CLASS="TableRowColor">
258 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
259 <CODE>&nbsp;<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A></CODE></FONT></TD>
260 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getDataNIO()">getDataNIO</A></B>()</CODE>
261
262 <BR>
263 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the java.nio.ByteBuffer.</TD>
264 </TR>
265 <TR BGCOLOR="white" CLASS="TableRowColor">
266 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
267 <CODE>&nbsp;int</CODE></FONT></TD>
268 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getOffset()">getOffset</A></B>()</CODE>
269
270 <BR>
271 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte offset into the data array.</TD>
272 </TR>
273 <TR BGCOLOR="white" CLASS="TableRowColor">
274 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
275 <CODE>&nbsp;boolean</CODE></FONT></TD>
276 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartial()">getPartial</A></B>()</CODE>
277
278 <BR>
279 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return whether this DatabaseEntry is configured to read or write partial
280 records.</TD>
281 </TR>
282 <TR BGCOLOR="white" CLASS="TableRowColor">
283 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
284 <CODE>&nbsp;int</CODE></FONT></TD>
285 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartialLength()">getPartialLength</A></B>()</CODE>
286
287 <BR>
288 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte length of the partial record being read or written by
289 the application, in bytes.</TD>
290 </TR>
291 <TR BGCOLOR="white" CLASS="TableRowColor">
292 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
293 <CODE>&nbsp;int</CODE></FONT></TD>
294 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getPartialOffset()">getPartialOffset</A></B>()</CODE>
295
296 <BR>
297 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the offset of the partial record being read or written by the
298 application, in bytes.</TD>
299 </TR>
300 <TR BGCOLOR="white" CLASS="TableRowColor">
301 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
302 <CODE>&nbsp;boolean</CODE></FONT></TD>
303 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getReadOnly()">getReadOnly</A></B>()</CODE>
304
305 <BR>
306 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return whether this DatabaseEntry is configured as read only.</TD>
307 </TR>
308 <TR BGCOLOR="white" CLASS="TableRowColor">
309 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
310 <CODE>&nbsp;int</CODE></FONT></TD>
311 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getRecordNumber()">getRecordNumber</A></B>()</CODE>
312
313 <BR>
314 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the record number encoded in this entry's buffer.</TD>
315 </TR>
316 <TR BGCOLOR="white" CLASS="TableRowColor">
317 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
318 <CODE>&nbsp;boolean</CODE></FONT></TD>
319 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getReuseBuffer()">getReuseBuffer</A></B>()</CODE>
320
321 <BR>
322 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the whether the entry is configured to reuse the buffer.</TD>
323 </TR>
324 <TR BGCOLOR="white" CLASS="TableRowColor">
325 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
326 <CODE>&nbsp;int</CODE></FONT></TD>
327 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()">getSize</A></B>()</CODE>
328
329 <BR>
330 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the byte size of the data array.</TD>
331 </TR>
332 <TR BGCOLOR="white" CLASS="TableRowColor">
333 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
334 <CODE>&nbsp;boolean</CODE></FONT></TD>
335 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getUserBuffer()">getUserBuffer</A></B>()</CODE>
336
337 <BR>
338 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the whether the buffer in this entry is owned by the
339 application.</TD>
340 </TR>
341 <TR BGCOLOR="white" CLASS="TableRowColor">
342 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
343 <CODE>&nbsp;int</CODE></FONT></TD>
344 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getUserBufferLength()">getUserBufferLength</A></B>()</CODE>
345
346 <BR>
347 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the length of the application's buffer.</TD>
348 </TR>
349 <TR BGCOLOR="white" CLASS="TableRowColor">
350 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
351 <CODE>&nbsp;int</CODE></FONT></TD>
352 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#hashCode()">hashCode</A></B>()</CODE>
353
354 <BR>
355 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a hash code based on the data value.</TD>
356 </TR>
357 <TR BGCOLOR="white" CLASS="TableRowColor">
358 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
359 <CODE>&nbsp;void</CODE></FONT></TD>
360 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setData(byte[])">setData</A></B>(byte[]&nbsp;data)</CODE>
361
362 <BR>
363 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the byte array.</TD>
364 </TR>
365 <TR BGCOLOR="white" CLASS="TableRowColor">
366 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
367 <CODE>&nbsp;void</CODE></FONT></TD>
368 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setData(byte[], int, int)">setData</A></B>(byte[]&nbsp;data,
369 int&nbsp;offset,
370 int&nbsp;size)</CODE>
371
372 <BR>
373 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the byte array, offset and size.</TD>
374 </TR>
375 <TR BGCOLOR="white" CLASS="TableRowColor">
376 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
377 <CODE>&nbsp;void</CODE></FONT></TD>
378 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setDataNIO(java.nio.ByteBuffer)">setDataNIO</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</CODE>
379
380 <BR>
381 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the java.nio.ByteBuffer.</TD>
382 </TR>
383 <TR BGCOLOR="white" CLASS="TableRowColor">
384 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
385 <CODE>&nbsp;void</CODE></FONT></TD>
386 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setDataNIO(java.nio.ByteBuffer, int, int)">setDataNIO</A></B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data,
387 int&nbsp;offset,
388 int&nbsp;size)</CODE>
389
390 <BR>
391 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the java.nio.ByteBuffer (or the backing array if passed a non-direct
392 ByteBuffer,) offset and size.</TD>
393 </TR>
394 <TR BGCOLOR="white" CLASS="TableRowColor">
395 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
396 <CODE>&nbsp;void</CODE></FONT></TD>
397 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setOffset(int)">setOffset</A></B>(int&nbsp;offset)</CODE>
398
399 <BR>
400 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte offset into the data array.</TD>
401 </TR>
402 <TR BGCOLOR="white" CLASS="TableRowColor">
403 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
404 <CODE>&nbsp;void</CODE></FONT></TD>
405 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(boolean)">setPartial</A></B>(boolean&nbsp;partial)</CODE>
406
407 <BR>
408 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configure this DatabaseEntry to read or write partial records.</TD>
409 </TR>
410 <TR BGCOLOR="white" CLASS="TableRowColor">
411 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
412 <CODE>&nbsp;void</CODE></FONT></TD>
413 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)">setPartial</A></B>(int&nbsp;doff,
414 int&nbsp;dlen,
415 boolean&nbsp;partial)</CODE>
416
417 <BR>
418 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures this DatabaseEntry to read or write partial records.</TD>
419 </TR>
420 <TR BGCOLOR="white" CLASS="TableRowColor">
421 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
422 <CODE>&nbsp;void</CODE></FONT></TD>
423 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartialLength(int)">setPartialLength</A></B>(int&nbsp;dlen)</CODE>
424
425 <BR>
426 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte length of the partial record being read or written by
427 the application, in bytes.</TD>
428 </TR>
429 <TR BGCOLOR="white" CLASS="TableRowColor">
430 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
431 <CODE>&nbsp;void</CODE></FONT></TD>
432 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartialOffset(int)">setPartialOffset</A></B>(int&nbsp;doff)</CODE>
433
434 <BR>
435 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the offset of the partial record being read or written by the
436 application, in bytes.</TD>
437 </TR>
438 <TR BGCOLOR="white" CLASS="TableRowColor">
439 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
440 <CODE>&nbsp;void</CODE></FONT></TD>
441 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReadOnly(boolean)">setReadOnly</A></B>(boolean&nbsp;readonly)</CODE>
442
443 <BR>
444 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configure this DatabaseEntry as read only.</TD>
445 </TR>
446 <TR BGCOLOR="white" CLASS="TableRowColor">
447 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
448 <CODE>&nbsp;void</CODE></FONT></TD>
449 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setRecordNumber(int)">setRecordNumber</A></B>(int&nbsp;recno)</CODE>
450
451 <BR>
452 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialize the entry from a logical record number.</TD>
453 </TR>
454 <TR BGCOLOR="white" CLASS="TableRowColor">
455 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
456 <CODE>&nbsp;void</CODE></FONT></TD>
457 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReuseBuffer(boolean)">setReuseBuffer</A></B>(boolean&nbsp;reuse)</CODE>
458
459 <BR>
460 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the entry to try to reuse the buffer before allocating a new
461 one.</TD>
462 </TR>
463 <TR BGCOLOR="white" CLASS="TableRowColor">
464 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
465 <CODE>&nbsp;void</CODE></FONT></TD>
466 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setSize(int)">setSize</A></B>(int&nbsp;size)</CODE>
467
468 <BR>
469 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the byte size of the data array.</TD>
470 </TR>
471 <TR BGCOLOR="white" CLASS="TableRowColor">
472 <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
473 <CODE>&nbsp;void</CODE></FONT></TD>
474 <TD><CODE><B><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)">setUserBuffer</A></B>(int&nbsp;length,
475 boolean&nbsp;usermem)</CODE>
476
477 <BR>
478 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Configures the entry with an application-owned buffer.</TD>
479 </TR>
480 </TABLE>
481 &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
482 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
483 <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
484 <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
485 </TR>
486 <TR BGCOLOR="white" CLASS="TableRowColor">
487 <TD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
488 </TR>
489 </TABLE>
490 &nbsp;
491 <P>
492
493 <!-- ========= CONSTRUCTOR DETAIL ======== -->
494
495 <A NAME="constructor_detail"><!-- --></A>
496 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
497 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
498 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
499 <B>Constructor Detail</B></FONT></TH>
500 </TR>
501 </TABLE>
502
503 <A NAME="DatabaseEntry()"><!-- --></A><H3>
504 DatabaseEntry</H3>
505 <PRE>
506 public <B>DatabaseEntry</B>()</PRE>
507 <DL>
508 <DD>Construct a DatabaseEntry with null data. The offset and size are set to
509 zero.
510 <P>
511 </DL>
512 <HR>
513
514 <A NAME="DatabaseEntry(byte[])"><!-- --></A><H3>
515 DatabaseEntry</H3>
516 <PRE>
517 public <B>DatabaseEntry</B>(byte[]&nbsp;data)</PRE>
518 <DL>
519 <DD>Construct a DatabaseEntry with a given byte array. The offset is
520 set to zero; the size is set to the length of the array, or to zero if
521 null is passed.
522 <p>
523 <P>
524 <DL>
525 <DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.</DL>
526 </DL>
527 <HR>
528
529 <A NAME="DatabaseEntry(byte[], int, int)"><!-- --></A><H3>
530 DatabaseEntry</H3>
531 <PRE>
532 public <B>DatabaseEntry</B>(byte[]&nbsp;data,
533 int&nbsp;offset,
534 int&nbsp;size)</PRE>
535 <DL>
536 <DD>Constructs a DatabaseEntry with a given byte array, offset and size.
537 <p>
538 <P>
539 <DL>
540 <DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.<DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
541 </DL>
542 <HR>
543
544 <A NAME="DatabaseEntry(java.nio.ByteBuffer)"><!-- --></A><H3>
545 DatabaseEntry</H3>
546 <PRE>
547 public <B>DatabaseEntry</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</PRE>
548 <DL>
549 <DD>Construct a DatabaseEntry with a given native I/O buffer. If the buffer is
550 non-direct, the buffer's backing array is used. If the buffer is direct,
551 the DatabaseEntry is configured with an application-owned buffer whose
552 length is set to the ByteBuffer's capacity less its position. The
553 DatabaseEntry's size is set to the ByteBuffer's limit less its position and
554 the offset is set to buffer's position (adjusted by arrayOffset if the
555 buffer is non-direct.)
556 <p>
557 <P>
558 <DL>
559 <DT><B>Parameters:</B><DD><CODE>data</CODE> - NIO byte buffer wrapped by the DatabaseEntry.</DL>
560 </DL>
561
562 <!-- ============ METHOD DETAIL ========== -->
563
564 <A NAME="method_detail"><!-- --></A>
565 <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
566 <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
567 <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
568 <B>Method Detail</B></FONT></TH>
569 </TR>
570 </TABLE>
571
572 <A NAME="getData()"><!-- --></A><H3>
573 getData</H3>
574 <PRE>
575 public byte[] <B>getData</B>()</PRE>
576 <DL>
577 <DD>Return the byte array.
578 <p>
579 For a DatabaseEntry that is used as an output parameter, the byte
580 array will always be a newly allocated array. The byte array specified
581 by the caller will not be used and may be null.
582 <p>
583 <P>
584 <DD><DL>
585
586 <DT><B>Returns:</B><DD>The byte array.</DL>
587 </DD>
588 </DL>
589 <HR>
590
591 <A NAME="getDataNIO()"><!-- --></A><H3>
592 getDataNIO</H3>
593 <PRE>
594 public <A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A> <B>getDataNIO</B>()</PRE>
595 <DL>
596 <DD>Return the java.nio.ByteBuffer.
597 <p>
598 Used to access the underlying data when the DatabaseEntry is
599 configured to utilize a java.nio.ByteBuffer.
600 <p>
601 <P>
602 <DD><DL>
603
604 <DT><B>Returns:</B><DD>The underlying java.nio.ByteBuffer.</DL>
605 </DD>
606 </DL>
607 <HR>
608
609 <A NAME="setData(byte[], int, int)"><!-- --></A><H3>
610 setData</H3>
611 <PRE>
612 public void <B>setData</B>(byte[]&nbsp;data,
613 int&nbsp;offset,
614 int&nbsp;size)</PRE>
615 <DL>
616 <DD>Sets the byte array, offset and size.
617 <p>
618 <P>
619 <DD><DL>
620 <DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.<DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
621 </DD>
622 </DL>
623 <HR>
624
625 <A NAME="setData(byte[])"><!-- --></A><H3>
626 setData</H3>
627 <PRE>
628 public void <B>setData</B>(byte[]&nbsp;data)</PRE>
629 <DL>
630 <DD>Sets the byte array. The offset is set to zero; the size is set to the
631 length of the array, or to zero if null is passed.
632 <p>
633 <P>
634 <DD><DL>
635 <DT><B>Parameters:</B><DD><CODE>data</CODE> - Byte array wrapped by the DatabaseEntry.</DL>
636 </DD>
637 </DL>
638 <HR>
639
640 <A NAME="setDataNIO(java.nio.ByteBuffer, int, int)"><!-- --></A><H3>
641 setDataNIO</H3>
642 <PRE>
643 public void <B>setDataNIO</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data,
644 int&nbsp;offset,
645 int&nbsp;size)</PRE>
646 <DL>
647 <DD>Sets the java.nio.ByteBuffer (or the backing array if passed a non-direct
648 ByteBuffer,) offset and size. If passed a direct ByteBuffer, the entry is
649 configured with an application-owned buffer whose length is set to the
650 ByteBuffer's capacity less the offset.
651 <p>
652 <P>
653 <DD><DL>
654 <DT><B>Parameters:</B><DD><CODE>data</CODE> - java.nio.ByteBuffer wrapped by the DatabaseEntry.<DD><CODE>offset</CODE> - int offset into the ByteBuffer where the DatabaseEntry data begins.<DD><CODE>size</CODE> - int size of the ByteBuffer available.</DL>
655 </DD>
656 </DL>
657 <HR>
658
659 <A NAME="setDataNIO(java.nio.ByteBuffer)"><!-- --></A><H3>
660 setDataNIO</H3>
661 <PRE>
662 public void <B>setDataNIO</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/nio/ByteBuffer.html?is-external=true" title="class or interface in java.nio">ByteBuffer</A>&nbsp;data)</PRE>
663 <DL>
664 <DD>Sets the java.nio.ByteBuffer. The offset is set to the ByteBuffer's
665 position; the size is set to the ByteBuffer's limit less its position, or to
666 zero if null is passed. If the ByteBuffer is non-direct, the backing array
667 will be used. If passed a direct ByteBuffer, the entry is configured with
668 an application-owned buffer whose length is set to the ByteBuffer's capacity
669 less its current position. No call to <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setUserBuffer(int, boolean)"><CODE>setUserBuffer(int, boolean)</CODE></A> is required
670 after setting the ByteBuffer.
671 <p>
672 <P>
673 <DD><DL>
674 <DT><B>Parameters:</B><DD><CODE>data</CODE> - java.nio.ByteBuffer wrapped by the DatabaseEntry.</DL>
675 </DD>
676 </DL>
677 <HR>
678
679 <A NAME="getOffset()"><!-- --></A><H3>
680 getOffset</H3>
681 <PRE>
682 public int <B>getOffset</B>()</PRE>
683 <DL>
684 <DD>Return the byte offset into the data array.
685 <p>
686 For a DatabaseEntry that is used as an output parameter, the offset
687 will always be zero.
688 <p>
689 <P>
690 <DD><DL>
691
692 <DT><B>Returns:</B><DD>Offset in the first byte in the byte array to be included.</DL>
693 </DD>
694 </DL>
695 <HR>
696
697 <A NAME="setOffset(int)"><!-- --></A><H3>
698 setOffset</H3>
699 <PRE>
700 public void <B>setOffset</B>(int&nbsp;offset)</PRE>
701 <DL>
702 <DD>Set the byte offset into the data array.
703 <p>
704 <P>
705 <DD><DL>
706 <DT><B>Parameters:</B><DD><CODE>offset</CODE> - Offset in the first byte in the byte array to be included.</DL>
707 </DD>
708 </DL>
709 <HR>
710
711 <A NAME="getPartialLength()"><!-- --></A><H3>
712 getPartialLength</H3>
713 <PRE>
714 public int <B>getPartialLength</B>()</PRE>
715 <DL>
716 <DD>Return the byte length of the partial record being read or written by
717 the application, in bytes.
718 <p>
719 Note that the Partial properties are set only by the caller. They
720 will never be set by a Database or Cursor method.
721 <p>
722 <P>
723 <DD><DL>
724
725 <DT><B>Returns:</B><DD>The byte length of the partial record being read or written by the
726 application, in bytes.
727 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
728 </DD>
729 </DL>
730 <HR>
731
732 <A NAME="getPartialOffset()"><!-- --></A><H3>
733 getPartialOffset</H3>
734 <PRE>
735 public int <B>getPartialOffset</B>()</PRE>
736 <DL>
737 <DD>Return the offset of the partial record being read or written by the
738 application, in bytes.
739 <p>
740 Note that the Partial properties are set only by the caller. They
741 will never be set by a Database or Cursor method.
742 <p>
743 <P>
744 <DD><DL>
745
746 <DT><B>Returns:</B><DD>The offset of the partial record being read or written by the
747 application, in bytes.
748 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
749 </DD>
750 </DL>
751 <HR>
752
753 <A NAME="getPartial()"><!-- --></A><H3>
754 getPartial</H3>
755 <PRE>
756 public boolean <B>getPartial</B>()</PRE>
757 <DL>
758 <DD>Return whether this DatabaseEntry is configured to read or write partial
759 records.
760 <p>
761 Note that the Partial properties are set only by the caller. They
762 will never be set by a Database or Cursor method.
763 <p>
764 <P>
765 <DD><DL>
766
767 <DT><B>Returns:</B><DD>Whether this DatabaseEntry is configured to read or write partial
768 records.
769 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
770 </DD>
771 </DL>
772 <HR>
773
774 <A NAME="setPartialOffset(int)"><!-- --></A><H3>
775 setPartialOffset</H3>
776 <PRE>
777 public void <B>setPartialOffset</B>(int&nbsp;doff)</PRE>
778 <DL>
779 <DD>Set the offset of the partial record being read or written by the
780 application, in bytes.
781 <p>
782 Note that the Partial properties are set only by the caller. They
783 will never be set by a Database or Cursor method.
784 <p>
785 <P>
786 <DD><DL>
787 <DT><B>Parameters:</B><DD><CODE>doff</CODE> - The offset of the partial record being read or written by the
788 application, in bytes.
789 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
790 </DD>
791 </DL>
792 <HR>
793
794 <A NAME="setPartialLength(int)"><!-- --></A><H3>
795 setPartialLength</H3>
796 <PRE>
797 public void <B>setPartialLength</B>(int&nbsp;dlen)</PRE>
798 <DL>
799 <DD>Set the byte length of the partial record being read or written by
800 the application, in bytes.
801 <p>
802 Note that the Partial properties are set only by the caller. They
803 will never be set by a Database or Cursor method.
804 <p>
805 <P>
806 <DD><DL>
807 <DT><B>Parameters:</B><DD><CODE>dlen</CODE> - The byte length of the partial record being read or written by the
808 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>application, in bytes.</CODE></A></DL>
809 </DD>
810 </DL>
811 <HR>
812
813 <A NAME="setPartial(boolean)"><!-- --></A><H3>
814 setPartial</H3>
815 <PRE>
816 public void <B>setPartial</B>(boolean&nbsp;partial)</PRE>
817 <DL>
818 <DD>Configure this DatabaseEntry to read or write partial records.
819 <p>
820 Note that the Partial properties are set only by the caller. They
821 will never be set by a Database or Cursor method.
822 <p>
823 <P>
824 <DD><DL>
825 <DT><B>Parameters:</B><DD><CODE>partial</CODE> - Whether this DatabaseEntry is configured to read or write partial
826 records.
827 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setPartial(int, int, boolean)"><CODE>setPartial(int,int,boolean)</CODE></A></DL>
828 </DD>
829 </DL>
830 <HR>
831
832 <A NAME="setPartial(int, int, boolean)"><!-- --></A><H3>
833 setPartial</H3>
834 <PRE>
835 public void <B>setPartial</B>(int&nbsp;doff,
836 int&nbsp;dlen,
837 boolean&nbsp;partial)</PRE>
838 <DL>
839 <DD>Configures this DatabaseEntry to read or write partial records.
840 <p>
841 Do partial retrieval or storage of an item. If the calling
842 application is doing a retrieval, length bytes specified by
843 <tt>dlen</tt>, starting at the offset set by <tt>doff</tt> bytes from
844 the beginning of the retrieved data record are returned as if they
845 comprised the entire record. If any or all of the specified bytes do
846 not exist in the record, the get is successful, and any existing bytes
847 are returned.
848 <p>
849 For example, if the data portion of a retrieved record was 100 bytes,
850 and a partial retrieval was done using a DatabaseEntry having a partial
851 length of 20 and a partial offset of 85, the retrieval would succeed and
852 the retrieved data would be the last 15 bytes of the record.
853 <p>
854 If the calling application is storing an item, length bytes specified
855 by <tt>dlen</tt>, starting at the offset set by <tt>doff</tt>
856 bytes from the beginning of the specified key's data item are replaced
857 by the data specified by the DatabaseEntry. If the partial length is
858 smaller than the data, the record will grow; if the partial length is
859 larger than the data, the record will shrink. If the specified bytes do
860 not exist, the record will be extended using nul bytes as necessary, and
861 the store will succeed.
862 <p>
863 It is an error to specify a partial key when performing a put
864 operation of any kind.
865 <p>
866 It is an error to attempt a partial store using the <A HREF="../../../com/sleepycat/db/Database.html#put(com.sleepycat.db.Transaction, com.sleepycat.db.DatabaseEntry, com.sleepycat.db.DatabaseEntry)"><CODE>Database.put</CODE></A> method in a database that supports duplicate records. Partial
867 stores in databases supporting duplicate records must be done using a
868 cursor method.
869 <p>
870 Note that the Partial properties are set only by the caller. They
871 will never be set by a Database or Cursor method.
872 <p>
873 <P>
874 <DD><DL>
875 <DT><B>Parameters:</B><DD><CODE>doff</CODE> - The offset of the partial record being read or written by the
876 application, in bytes.
877 <p><DD><CODE>dlen</CODE> - The byte length of the partial record being read or written by the
878 application, in bytes.
879 <p><DD><CODE>partial</CODE> - Whether this DatabaseEntry is configured to read or write partial
880 records.</DL>
881 </DD>
882 </DL>
883 <HR>
884
885 <A NAME="getReadOnly()"><!-- --></A><H3>
886 getReadOnly</H3>
887 <PRE>
888 public boolean <B>getReadOnly</B>()</PRE>
889 <DL>
890 <DD>Return whether this DatabaseEntry is configured as read only.
891 <p>
892 <P>
893 <DD><DL>
894
895 <DT><B>Returns:</B><DD>Whether this DatabaseEntry is configured as read only.
896 <p><DT><B>See Also:</B><DD><A HREF="../../../com/sleepycat/db/DatabaseEntry.html#setReadOnly(boolean)"><CODE>setReadOnly(boolean)</CODE></A></DL>
897 </DD>
898 </DL>
899 <HR>
900
901 <A NAME="setReadOnly(boolean)"><!-- --></A><H3>
902 setReadOnly</H3>
903 <PRE>
904 public void <B>setReadOnly</B>(boolean&nbsp;readonly)</PRE>
905 <DL>
906 <DD>Configure this DatabaseEntry as read only.
907 <p>
908 <P>
909 <DD><DL>
910 <DT><B>Parameters:</B><DD><CODE>readonly</CODE> - Whether this DatabaseEntry is configured as read only.</DL>
911 </DD>
912 </DL>
913 <HR>
914
915 <A NAME="getRecordNumber()"><!-- --></A><H3>
916 getRecordNumber</H3>
917 <PRE>
918 public int <B>getRecordNumber</B>()</PRE>
919 <DL>
920 <DD>Return the record number encoded in this entry's buffer.
921 <p>
922 This method may be called at any time during the life of the application.
923 <p>
924 <P>
925 <DD><DL>
926
927 <DT><B>Returns:</B><DD>The record number encoded in this entry's buffer.</DL>
928 </DD>
929 </DL>
930 <HR>
931
932 <A NAME="setRecordNumber(int)"><!-- --></A><H3>
933 setRecordNumber</H3>
934 <PRE>
935 public void <B>setRecordNumber</B>(int&nbsp;recno)</PRE>
936 <DL>
937 <DD>Initialize the entry from a logical record number. Record numbers
938 are integer keys starting at 1. When this method is called the data,
939 size and offset fields are implicitly set to hold a byte array
940 representation of the integer key.
941 <P>
942 <DD><DL>
943 <DT><B>Parameters:</B><DD><CODE>recno</CODE> - the record number to be encoded</DL>
944 </DD>
945 </DL>
946 <HR>
947
948 <A NAME="getReuseBuffer()"><!-- --></A><H3>
949 getReuseBuffer</H3>
950 <PRE>
951 public boolean <B>getReuseBuffer</B>()</PRE>
952 <DL>
953 <DD>Return true if the whether the entry is configured to reuse the buffer.
954 <p>
955 This method may be called at any time during the life of the application.
956 <p>
957 <P>
958 <DD><DL>
959
960 <DT><B>Returns:</B><DD>True if the whether the entry is configured to reuse the buffer.</DL>
961 </DD>
962 </DL>
963 <HR>
964
965 <A NAME="setReuseBuffer(boolean)"><!-- --></A><H3>
966 setReuseBuffer</H3>
967 <PRE>
968 public void <B>setReuseBuffer</B>(boolean&nbsp;reuse)</PRE>
969 <DL>
970 <DD>Configures the entry to try to reuse the buffer before allocating a new
971 one.
972 <p>
973 <P>
974 <DD><DL>
975 <DT><B>Parameters:</B><DD><CODE>reuse</CODE> - whether to reuse the buffer</DL>
976 </DD>
977 </DL>
978 <HR>
979
980 <A NAME="getSize()"><!-- --></A><H3>
981 getSize</H3>
982 <PRE>
983 public int <B>getSize</B>()</PRE>
984 <DL>
985 <DD>Return the byte size of the data array.
986 <p>
987 For a DatabaseEntry that is used as an output parameter, the size
988 will always be the length of the data array.
989 <p>
990 <P>
991 <DD><DL>
992
993 <DT><B>Returns:</B><DD>Number of bytes in the byte array to be included.</DL>
994 </DD>
995 </DL>
996 <HR>
997
998 <A NAME="setSize(int)"><!-- --></A><H3>
999 setSize</H3>
1000 <PRE>
1001 public void <B>setSize</B>(int&nbsp;size)</PRE>
1002 <DL>
1003 <DD>Set the byte size of the data array.
1004 <p>
1005 <P>
1006 <DD><DL>
1007 <DT><B>Parameters:</B><DD><CODE>size</CODE> - Number of bytes in the byte array to be included.</DL>
1008 </DD>
1009 </DL>
1010 <HR>
1011
1012 <A NAME="getUserBuffer()"><!-- --></A><H3>
1013 getUserBuffer</H3>
1014 <PRE>
1015 public boolean <B>getUserBuffer</B>()</PRE>
1016 <DL>
1017 <DD>Return true if the whether the buffer in this entry is owned by the
1018 application.
1019 <p>
1020 This method may be called at any time during the life of the application.
1021 <p>
1022 <P>
1023 <DD><DL>
1024
1025 <DT><B>Returns:</B><DD>True if the whether the buffer in this entry is owned by the
1026 application.</DL>
1027 </DD>
1028 </DL>
1029 <HR>
1030
1031 <A NAME="getUserBufferLength()"><!-- --></A><H3>
1032 getUserBufferLength</H3>
1033 <PRE>
1034 public int <B>getUserBufferLength</B>()</PRE>
1035 <DL>
1036 <DD>Return the length of the application's buffer.
1037 <p>
1038 This method may be called at any time during the life of the application.
1039 <p>
1040 <P>
1041 <DD><DL>
1042
1043 <DT><B>Returns:</B><DD>The length of the application's buffer.</DL>
1044 </DD>
1045 </DL>
1046 <HR>
1047
1048 <A NAME="setUserBuffer(int, boolean)"><!-- --></A><H3>
1049 setUserBuffer</H3>
1050 <PRE>
1051 public void <B>setUserBuffer</B>(int&nbsp;length,
1052 boolean&nbsp;usermem)</PRE>
1053 <DL>
1054 <DD>Configures the entry with an application-owned buffer.
1055 <p>
1056 The <code>data</code> field of the entry must refer to a buffer that is
1057 at least <code>length</code> bytes in length.
1058 <p>
1059 If the length of the requested item is less than or equal to that number
1060 of bytes, the item is copied into the memory to which the
1061 <code>data</code> field refers. Otherwise, the <code>size</code> field
1062 is set to the length needed for the requested item, and a
1063 <A HREF="../../../com/sleepycat/db/MemoryException.html" title="class in com.sleepycat.db"><CODE>MemoryException</CODE></A> is thrown.
1064 <p>
1065 Applications can determine the length of a record by setting
1066 <code>length</code> to 0 and calling <A HREF="../../../com/sleepycat/db/DatabaseEntry.html#getSize()"><CODE>DatabaseEntry.getSize</CODE></A>
1067 on the return value.
1068 <p>
1069 <P>
1070 <DD><DL>
1071 <DT><B>Parameters:</B><DD><CODE>length</CODE> - the length of the buffer
1072 <p><DD><CODE>usermem</CODE> - whether the buffer is owned by the application</DL>
1073 </DD>
1074 </DL>
1075 <HR>
1076
1077 <A NAME="equals(java.lang.Object)"><!-- --></A><H3>
1078 equals</H3>
1079 <PRE>
1080 public boolean <B>equals</B>(<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;o)</PRE>
1081 <DL>
1082 <DD>Compares the data of two entries for byte-by-byte equality.
1083
1084 <p>In either entry, if the offset is non-zero or the size is not equal
1085 to the data array length, then only the data bounded by these values is
1086 compared. The data array length and offset need not be the same in both
1087 entries for them to be considered equal.</p>
1088
1089 <p>If the data array is null in one entry, then to be considered equal
1090 both entries must have a null data array.</p>
1091
1092 <p>If the partial property is set in either entry, then to be considered
1093 equal both entries must have the same partial properties: partial,
1094 partialOffset and partialLength.
1095 <P>
1096 <DD><DL>
1097 <DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
1098 </DD>
1099 <DD><DL>
1100 </DL>
1101 </DD>
1102 </DL>
1103 <HR>
1104
1105 <A NAME="hashCode()"><!-- --></A><H3>
1106 hashCode</H3>
1107 <PRE>
1108 public int <B>hashCode</B>()</PRE>
1109 <DL>
1110 <DD>Returns a hash code based on the data value.
1111 <P>
1112 <DD><DL>
1113 <DT><B>Overrides:</B><DD><CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A></CODE> in class <CODE><A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></DL>
1114 </DD>
1115 <DD><DL>
1116 </DL>
1117 </DD>
1118 </DL>
1119 <!-- ========= END OF CLASS DATA ========= -->
1120 <HR>
1121
1122
1123 <!-- ======= START OF BOTTOM NAVBAR ====== -->
1124 <A NAME="navbar_bottom"><!-- --></A>
1125 <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
1126 <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
1127 <TR>
1128 <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
1129 <A NAME="navbar_bottom_firstrow"><!-- --></A>
1130 <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
1131 <TR ALIGN="center" VALIGN="top">
1132 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
1133 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
1134 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
1135 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DatabaseEntry.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
1136 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
1137 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
1138 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
1139 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
1140 </TR>
1141 </TABLE>
1142 </TD>
1143 <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
1144 <b>Berkeley DB</b><br><font size="-1"> version 5.3.28</font></EM>
1145 </TD>
1146 </TR>
1147
1148 <TR>
1149 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1150 &nbsp;<A HREF="../../../com/sleepycat/db/DatabaseConfig.html" title="class in com.sleepycat.db"><B>PREV CLASS</B></A>&nbsp;
1151 &nbsp;<A HREF="../../../com/sleepycat/db/DatabaseException.html" title="class in com.sleepycat.db"><B>NEXT CLASS</B></A></FONT></TD>
1152 <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
1153 <A HREF="../../../index.html?com/sleepycat/db/DatabaseEntry.html" target="_top"><B>FRAMES</B></A> &nbsp;
1154 &nbsp;<A HREF="DatabaseEntry.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
1155 &nbsp;<SCRIPT type="text/javascript">
1156 <!--
1157 if(window==top) {
1158 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
1159 }
1160 //-->
1161 </SCRIPT>
1162 <NOSCRIPT>
1163 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
1164 </NOSCRIPT>
1165
1166
1167 </FONT></TD>
1168 </TR>
1169 <TR>
1170 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1171 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
1172 <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
1173 DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
1174 </TR>
1175 </TABLE>
1176 <A NAME="skip-navbar_bottom"></A>
1177 <!-- ======== END OF BOTTOM NAVBAR ======= -->
1178
1179 <HR>
1180 <font size=1>Copyright (c) 1996, 2013 Oracle and/or its affiliates. All rights reserved.</font>
1181 </BODY>
1182 </HTML>