Interface NewCpdTokens

  • public interface NewCpdTokens
    This builder is used to define tokens used by CPD algorithm on files. Example:
         .addToken(1, 10, 1, 15, "class")
         .addToken(1, 16, 1, 18, "IDENTIFIER")
         // Add more tokens
    • Method Detail

      • addToken

        NewCpdTokens addToken​(TextRange range,
                              java.lang.String image)
        Call this method to register a token in a range. Tokens should be registered in order.
        range - Token position. Use InputFile.newRange(int, int, int, int) to get a valid range.
        image - Text content of the token. Can be replaced by a constant placeholder for some tokens (like litterals).
      • save

        void save()
        Call this method only once when your are done with defining tokens of the file. It is not supported to save CPD tokens twice for the same file.