01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.nativerdf.btree;
07:
08: /**
09: * @author Arjohn Kampman
10: */
11: public interface RecordComparator {
12:
13: /**
14: * Compares the supplied <tt>key</tt> to the value of length
15: * <tt>length</tt>, starting at offset <tt>offset</tt> in the supplied
16: * <tt>data</tt> array.
17: *
18: * @param key
19: * A byte array representing the search key.
20: * @param data
21: * A byte array containing the value to compare the key to.
22: * @param offset
23: * The offset (0-based) of the value in <tt>data</tt>.
24: * @param length
25: * The length of the value.
26: * @return A negative integer when the key is smaller than the value, a
27: * positive integer when the key is larger than the value, or
28: * <tt>0</tt> when the key is equal to the value.
29: */
30: public int compareBTreeValues(byte[] key, byte[] data, int offset,
31: int length);
32: }
|