{
if ( isGreaterThan )
{
JdbmTupleBrowser browser =
new JdbmTupleBrowser( bt.browse( key ) );
list = new NoDupsEnumeration( browser, isGreaterThan );
}
else
{
/* According to the jdbm docs a browser is positioned right
* before a key greater than or equal to key. getNext() will
* return the next tuple with a key greater than or equal to
* key. getPrevious() used in descending scans for less than
* for equal to comparisions will not. We need to advance
* forward once and check if the returned Tuple key equals
* key. If it does then we do nothing feeding in the browser
* to the NoDupsCursor. If it does not we call getPrevious and
* pass it into the NoDupsCursor constructor.
*/
jdbm.helper.Tuple tuple = new jdbm.helper.Tuple();
TupleBrowser browser = bt.browse( key );
if ( browser.getNext( tuple ) )
{
Object greaterKey = tuple.getKey();
if ( 0 != comparator.compareKey( key, greaterKey ) )
{
// Make sure we don't return greaterKey in cursor
browser.getPrevious( tuple );
}
}
// If greaterKey != key above then it will not be returned.
list = new NoDupsEnumeration(
new JdbmTupleBrowser( browser ), isGreaterThan );
}
}
catch ( IOException e )
{