private void leftSearch ( SearchComparator comp , GBSNode p , GBSNode r , Object searchKey , SearchNode point ) { if ( r == null ) /* There is no upper predecessor */ { int idx = p . searchLeft ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( p , idx ) ; } else /* There is an upper predecessor */ { int xcc = comp . compare ( searchKey , r . rightMostKey ( ) ) ; if ( xcc == 0 ) /* Target is right-most in upper pred. */ point . setFound ( r , r . rightMostIndex ( ) ) ; else if ( xcc > 0 ) /* Target (if it exists) is in left */ { /* half of current node */ int idx = p . searchLeft ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( p , idx ) ; } else /* Target (if it exists) is in right */ { /* half of predecessor (if it exists) */ int idx = r . searchRight ( comp , searchKey ) ; if ( ! ( idx < 0 ) ) point . setFound ( r , idx ) ; } } }
Search after falling off a left edge .