Package spoon.support.compiler.jdt
Class PositionBuilder
- java.lang.Object
-
- spoon.support.compiler.jdt.PositionBuilder
-
public class PositionBuilder extends Object
Created by bdanglot on 07/07/16.
-
-
Constructor Summary
Constructors Constructor Description PositionBuilder(JDTTreeBuilder jdtTreeBuilder)
-
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)
-
-
-
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 ofcontent
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 ofcontent
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
-
-