Package spoon.support.compiler.jdt
Class PositionBuilder
java.lang.Object
spoon.support.compiler.jdt.PositionBuilder
Created by bdanglot on 07/07/16.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intfindNextNonWhitespace(char[] content, int maxOff, int off)static intgetEndOfComment(char[] content, int maxOff, int off)
-
Constructor Details
-
PositionBuilder
-
-
Method Details
-
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 ofcontentwhere 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 ofcontentwhere 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
-