Package com.sonar.sslr.api
Class Comments
java.lang.Object
com.sonar.sslr.api.Comments
Utility class to manipulate comment tokens
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCommentTokensAtLine(int line) Get the sorted list of lines containing at least a commentbooleanhasCommentTokensAtLine(int line) booleaniterator()Iterates over the collection of comment tokensintsize()Return the number of comment tokensMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Comments
-
Comments
public Comments(com.google.common.collect.ListMultimap<Integer, Token> comments, CommentAnalyser analyser)
-
-
Method Details
-
iterator
Iterates over the collection of comment tokens -
getLinesOfComment
Get the sorted list of lines containing at least a comment -
size
public int size()Return the number of comment tokens -
hasCommentTokensAtLine
public boolean hasCommentTokensAtLine(int line) - Parameters:
line- the line where we expect to find some comment tokens- Returns:
- true if there is at least one comment token at provided line
-
getCommentTokensAtLine
- Parameters:
line- the line where we expect to find some comment tokens- Returns:
- the list of comment tokens on this line
-
isBlank
- Parameters:
commentValue- the value of the comment- Returns:
- true if the value is considered to be a blank comment
-