Class PositionBuilder


  • public class PositionBuilder
    extends java.lang.Object
    Created by bdanglot on 07/07/16.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int findNextNonWhitespace​(char[] content, int maxOff, int off)  
      static int getEndOfComment​(char[] content, int maxOff, int off)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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