public synchronized BaseBuffer move ( int iRelPosition , FieldTable table ) throws DBException { int iKeyOrder = table . getRecord ( ) . getDefaultOrder ( ) ; if ( iKeyOrder == - 1 ) iKeyOrder = Constants . MAIN_KEY_AREA ; KeyAreaInfo keyArea = table . getRecord ( ) . getKeyArea ( iKeyOrder ) ; PKeyArea vKeyArea = this . getPKeyArea ( iKeyOrder ) ; // First, compare the current position with the record you are trying to read past. BaseBuffer buffer = ( BaseBuffer ) table . getDataSource ( ) ; if ( ( iRelPosition != Constants . FIRST_RECORD ) && ( iRelPosition != Constants . LAST_RECORD ) ) if ( ! vKeyArea . atCurrent ( buffer ) ) { keyArea . reverseKeyBuffer ( null , Constants . TEMP_KEY_AREA ) ; // Move these keys back to the record if ( keyArea . getUniqueKeyCode ( ) != Constants . UNIQUE ) // The main key is part of the comparison table . getRecord ( ) . getKeyArea ( Constants . MAIN_KEY_AREA ) . reverseKeyBuffer ( null , Constants . TEMP_KEY_AREA ) ; // Move these keys back to the record buffer = vKeyArea . doSeek ( "==" , table , keyArea ) ; // Reposition the key here } buffer = vKeyArea . doMove ( iRelPosition , table , keyArea ) ; this . saveCurrentKeys ( table , buffer , ( buffer == null ) ) ; return buffer ; }
Move the position of the record . See PKeyArea for the logic behind this method .