Class PositionBuilder


  • public class PositionBuilder
    extends Object
    Created by bdanglot on 07/07/16.
    • Constructor Detail

      • PositionBuilder

        public PositionBuilder​(JDTTreeBuilder jdtTreeBuilder)
    • Method Detail

      • findNextNonWhitespace

        public static int findNextNonWhitespace​(char[] content,
                                                int maxOff,
                                                int off)
        Parameters:
        content - the character array on which the search will be performed.
        maxOff - maximum acceptable return value.
        off - the offset of content where the search begins.
        Returns:
        index of first non whitespace char, searching forward. Can return 'off' if it is non whitespace. Note: all kinds of java comments are understood as whitespace too. The search must start out of comment or on the first character of the comment
      • getEndOfComment

        public static int getEndOfComment​(char[] content,
                                          int maxOff,
                                          int off)
        Parameters:
        content - the character array on which the search will be performed.
        maxOff - maximum acceptable return value.
        off - the offset of content where the search begins.
        Returns:
        if the off points at start of comment then it returns offset which points on last character of the comment if the off does not point at start of comment then it returns -1