protected int toNext ( int amount ) throws FetchException { if ( amount <= 1 ) { return ( amount <= 0 ) ? 0 : ( toNext ( ) ? 1 : 0 ) ; } int count = 0 ; disableKeyAndValue ( ) ; try { while ( amount > 0 ) { if ( toNext ( ) ) { count ++ ; amount -- ; } else { break ; } } } finally { enableKeyAndValue ( ) ; } return count ; }
Move the cursor to the next available entry incrementing by the amount given . The actual amount incremented is returned . If the amount is less then requested the cursor must be positioned after the last available entry . Subclasses may wish to override this method with a faster implementation .