com.sleepycat.db
Interface DbDupCompare
public interface DbDupCompare
An interface specifying a comparison function, which imposes a
total ordering on the duplicate data items in a Btree database.
Method Summary |
int |
compareDuplicates(Db db,
Dbt dbt1,
Dbt dbt2)
The DbDupCompare interface is used by the
Db.setDuplicatelicateCompare method. |
compareDuplicates
int compareDuplicates(Db db,
Dbt dbt1,
Dbt dbt2)
- The DbDupCompare interface is used by the
Db.setDuplicatelicateCompare method.
- Parameters:
db
- the enclosing database handle.dbt1
- a Dbt
representing
the application supplied data item.dbt2
- a Dbt
representing
the current tree's data item.
- Returns:
- The dup_compare_fcn function must return
an integer value less than, equal to, or greater than zero
if the first data item parameter is considered to be
respectively less than, equal to, or greater than the
second data item parameter. In addition, the comparison
function must cause the data items in the set to be
well-ordered . The comparison function must correctly
handle any data item values used by the application
(possibly including zero-length data items). The data
and size fields of the
Dbt
are the only fields that may be
used for the purposes of this comparison, and no
particular alignment of the memory to which the data
field refers may be assumed.