boolean checkSuffix ( char [ ] chars , int [ ] cursor ) { if ( suffix == null ) return true ; // Compute the only possible starting point. This only works because a clause's minlen // is an exact length for SQL-style patterns. This method is overridden for topic // patterns. int start = cursor [ 1 ] - suffix . minlen ; if ( start < cursor [ 0 ] ) // candidate is too short to possibly match return false ; if ( ! matchClause ( suffix , chars , new int [ ] { start , cursor [ 1 ] } ) ) return false ; // The suffix matches, so reflect that in the cursor cursor [ 1 ] = start ; return true ; }
Internal method to evaluate a candidate against the suffix