<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc on Wed Dec 03 16:22:07 EST 2003 --> <TITLE> KeyExtractor (Sleepycat Software, Inc. - Berkeley DB Java API) </TITLE> <META NAME="keywords" CONTENT="com.sleepycat.bdb.bind.KeyExtractor,KeyExtractor interface"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../style.css" TITLE="Style"> </HEAD> <SCRIPT> function asd() { parent.document.title="KeyExtractor (Sleepycat Software, Inc. - Berkeley DB Java API)"; } </SCRIPT> <BODY BGCOLOR="white" onload="asd();"> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_top"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/KeyExtractor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB</b><br><font size="-1"> version 4.2.52</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/sleepycat/bdb/bind/EntityBinding.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="KeyExtractor.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.sleepycat.bdb.bind</FONT> <BR> Interface KeyExtractor</H2> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../com/sleepycat/bdb/bind/serial/SerialSerialKeyExtractor.html">SerialSerialKeyExtractor</A>, <A HREF="../../../../com/sleepycat/bdb/bind/serial/TupleSerialKeyExtractor.html">TupleSerialKeyExtractor</A>, <A HREF="../../../../com/sleepycat/bdb/bind/tuple/TupleTupleKeyExtractor.html">TupleTupleKeyExtractor</A></DD> </DL> <HR> <DL> <DT>public interface <B>KeyExtractor</B></DL> <P> The interface implemented for extracting the index key from primary key and/or value buffers, and for clearing the index key in a value buffer. The implementation of this interface defines a specific index key for use in a database, and that is independent of any bindings that may be used. <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#clearIndexKey(com.sleepycat.bdb.bind.DataBuffer)">clearIndexKey</A></B>(<A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> valueData)</CODE> <BR> Clears the index key in a value buffer.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)">extractIndexKey</A></B>(<A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> primaryKeyData, <A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> valueData, <A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> indexKeyData)</CODE> <BR> Extracts the index key data from primary key and value buffers.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#getIndexKeyFormat()">getIndexKeyFormat</A></B>()</CODE> <BR> Returns the format of the index key data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#getPrimaryKeyFormat()">getPrimaryKeyFormat</A></B>()</CODE> <BR> Returns the format of the primary key data or null if the index key data is not derived from the primary key data.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#getValueFormat()">getValueFormat</A></B>()</CODE> <BR> Returns the format of the value data or null if the index key data is not derived from the value data.</TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)"><!-- --></A><H3> extractIndexKey</H3> <PRE> public void <B>extractIndexKey</B>(<A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> primaryKeyData, <A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> valueData, <A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> indexKeyData) throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE> <DL> <DD>Extracts the index key data from primary key and value buffers. The index key is extracted when saving the data record identified by the primary key and value buffers, in order to add or remove an index entry in the database for that data record. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>primaryKeyData</CODE> - is the source primary key data, or null if no primary key data is used to construct the index key, in which case <A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#getPrimaryKeyFormat()"><CODE>getPrimaryKeyFormat()</CODE></A> should also return null.<DD><CODE>valueData</CODE> - is the source value data, or null if no value data is used to construct the index key, in which case <A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#getValueFormat()"><CODE>getValueFormat()</CODE></A> should also return null.<DD><CODE>indexKeyData</CODE> - is the destination index key buffer. For index keys which are optionally present, the buffer's length should be set to zero to indicate that the key is not present or null. <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></CODE></DL> </DD> </DL> <HR> <A NAME="clearIndexKey(com.sleepycat.bdb.bind.DataBuffer)"><!-- --></A><H3> clearIndexKey</H3> <PRE> public void <B>clearIndexKey</B>(<A HREF="../../../../com/sleepycat/bdb/bind/DataBuffer.html">DataBuffer</A> valueData) throws <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE> <DL> <DD>Clears the index key in a value buffer. The index key is cleared when the index is for a foreign key identifying a record that has been deleted. This method is called only if the <A HREF="../../../../com/sleepycat/bdb/ForeignKeyIndex.html"><CODE>ForeignKeyIndex</CODE></A> is configured with <A HREF="../../../../com/sleepycat/bdb/ForeignKeyIndex.html#ON_DELETE_CLEAR"><CODE>ForeignKeyIndex.ON_DELETE_CLEAR</CODE></A>. It is never called for index keys that are derived from primary key data, since in this case <A HREF="../../../../com/sleepycat/bdb/ForeignKeyIndex.html#ON_DELETE_CLEAR"><CODE>ForeignKeyIndex.ON_DELETE_CLEAR</CODE></A> is not allowed. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>valueData</CODE> - is the source and destination value data. On entry this contains the index key to be cleared. It should be changed by this method such that <A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)"><CODE>extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)</CODE></A> will extract a null key (set the buffer length to zero). Other data in the buffer should remain unchanged. <DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></CODE></DL> </DD> </DL> <HR> <A NAME="getPrimaryKeyFormat()"><!-- --></A><H3> getPrimaryKeyFormat</H3> <PRE> public <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A> <B>getPrimaryKeyFormat</B>()</PRE> <DL> <DD>Returns the format of the primary key data or null if the index key data is not derived from the primary key data. If this method returns null, then null will be passed for the <code>primaryKeyData</code> parameter of <A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)"><CODE>extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)</CODE></A>. <P> <DD><DL> <DT><B>Returns:</B><DD>the format of the primary key data or null.</DL> </DD> </DL> <HR> <A NAME="getValueFormat()"><!-- --></A><H3> getValueFormat</H3> <PRE> public <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A> <B>getValueFormat</B>()</PRE> <DL> <DD>Returns the format of the value data or null if the index key data is not derived from the value data. If this method returns null, then null will be passed for the <code>valueData</code> parameter of <A HREF="../../../../com/sleepycat/bdb/bind/KeyExtractor.html#extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)"><CODE>extractIndexKey(com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer, com.sleepycat.bdb.bind.DataBuffer)</CODE></A>. <P> <DD><DL> <DT><B>Returns:</B><DD>the format of the value data or null.</DL> </DD> </DL> <HR> <A NAME="getIndexKeyFormat()"><!-- --></A><H3> getIndexKeyFormat</H3> <PRE> public <A HREF="../../../../com/sleepycat/bdb/bind/DataFormat.html">DataFormat</A> <B>getIndexKeyFormat</B>()</PRE> <DL> <DD>Returns the format of the index key data. <P> <DD><DL> <DT><B>Returns:</B><DD>the format of the index key data.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ========== START OF NAVBAR ========== --> <A NAME="navbar_bottom"><!-- --></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/KeyExtractor.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Berkeley DB</b><br><font size="-1"> version 4.2.52</font></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/sleepycat/bdb/bind/EntityBinding.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="KeyExtractor.html" TARGET="_top"><B>NO FRAMES</B></A> <SCRIPT> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <!-- =========== END OF NAVBAR =========== --> <HR> <font size=1><a href="../../../../../sleepycat/legal.html">Copyright (c) 1996-2003</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> </BODY> </HTML>