public static int skipCQLId ( String toParse , int idx ) { if ( idx >= toParse . length ( ) ) throw new IllegalArgumentException ( ) ; char c = toParse . charAt ( idx ) ; if ( isCqlIdentifierChar ( c ) ) { while ( idx < toParse . length ( ) && isCqlIdentifierChar ( toParse . charAt ( idx ) ) ) idx ++ ; return idx ; } if ( c != ' ' ) throw new IllegalArgumentException ( ) ; while ( ++ idx < toParse . length ( ) ) { c = toParse . charAt ( idx ) ; if ( c != ' ' ) continue ; if ( idx + 1 < toParse . length ( ) && toParse . charAt ( idx + 1 ) == ' ' ) ++ idx ; // this is an escaped double quote, skip it else return idx + 1 ; } throw new IllegalArgumentException ( ) ; }
Assuming that idx points to the beginning of a CQL identifier in toParse returns the index of the first character after this identifier .