Code example for StringTokenizer

Methods: countTokens, nextToken

0
    @Override 
    public boolean match(CodeSearch matchCd, List<CodeReference> out)
    { 
         
        String code = matchCd.getCode();
        StringTokenizer tok = new StringTokenizer(code, ":");
        if (tok.countTokens() == 3)
        { 
            //Possible Valuid URI Pattern 
            String uri = tok.nextToken();
            if (uri.compareToIgnoreCase("uri") == 0)
            { 
                return super.match(matchCd, out);
            } 
        } 
        return true; 
    } 
     
}