Berkeley DB
version 4.2.52

com.sleepycat.db
Interface DbBtreePrefix


public interface DbBtreePrefix

An interface specifying a comparison function, which specifies the number of bytes needed to differentiate Btree keys.


Method Summary
 int prefix(Db db, Dbt dbt1, Dbt dbt2)
          The DbBtreePrefix interface is used by the Db.setBtreePrefix method.
 

Method Detail

prefix

public int prefix(Db db,
                  Dbt dbt1,
                  Dbt dbt2)
The DbBtreePrefix interface is used by the Db.setBtreePrefix method.

Parameters:
db - the enclosing database handle.
dbt1 - a Dbt representing a database key.
dbt2 - a Dbt representing a database key.
Returns:
The bt_prefix_fcn function must return the number of bytes of the second key parameter that would be required by the Btree key comparison function to determine the second key parameter's ordering relationship with respect to the first key parameter. If the two keys are equal, the key length should be returned. The prefix function must correctly handle any key values used by the application (possibly including zero-length keys). The data and size fields of the Dbt are the only fields that may be used for the purposes of this determination, and no particular alignment of the memory to which the data field refers may be assumed.


Berkeley DB
version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.