@NotThreadSafe
public class CommentMetrics
extends java.lang.Object
Instances of this class are not safe for use by multiple threads without external synchronization.
| Constructor | Description |
|---|---|
CommentMetrics() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(com.github.javaparser.ast.comments.BlockComment pComment) |
Add metrics from a block comment.
|
void |
add(com.github.javaparser.ast.comments.JavadocComment pComment) |
Add metrics from a JavaDoc comment.
|
void |
add(com.github.javaparser.ast.comments.LineComment pComment) |
Add metrics from a line comment.
|
void |
add(CommentMetrics pValues) |
Add the values of another
CommentMetrics to this instance. |
int |
getBlockCommentsLength() |
Get the total number of significant characters in the
BlockComment instances added to
this instance. |
int |
getJavaDocCommentsLength() |
Get the total number of significant characters in the
JavadocComment instances added
to this instance. |
int |
getLineCommentsLength() |
Get the total number of significant characters in the
LineComment instances added to
this instance. |
int |
getNumBlockCommentLines() |
Get the number of block comment lines collected from the
BlockComment instances added
to this instance. |
int |
getNumBlockComments() |
Get the number of block comments collected from the
BlockComment instances added to
this instance. |
int |
getNumJavaDocComments() |
Get the number of JavaDoc comments collected from the
JavadocComment instances added
to this instance. |
int |
getNumJavaDocLines() |
Get the number of lines collected from the
JavadocComment instances added to this
instance. |
int |
getNumLineComments() |
Get the number of line comments collected from the
LineComment instances added to
this instance. |
boolean |
isEmpty() |
Is this instance empty?
|
public boolean isEmpty()
public int getNumLineComments()
LineComment instances added to
this instance.public int getLineCommentsLength()
LineComment instances added to
this instance. Significant characters are the ones remaining when leading and trailing
whitespace has been trimmed away.public int getNumBlockComments()
BlockComment instances added to
this instance.public int getNumBlockCommentLines()
BlockComment instances added
to this instance.public int getBlockCommentsLength()
BlockComment instances added to
this instance. Significant characters are the ones remaining when leading and trailing
whitespace and asterisks have been trimmed away from each line in the comments.public int getNumJavaDocComments()
JavadocComment instances added
to this instance.public int getNumJavaDocLines()
JavadocComment instances added to this
instance.public int getJavaDocCommentsLength()
JavadocComment instances added
to this instance. Significant characters are the ones remaining when leading and trailing
whitespace and asterisks have been trimmed away from each line in the comments.public void add(@Nonnull
CommentMetrics pValues)
CommentMetrics to this instance.pValues - The values to add.java.lang.NullPointerException - if pValues is null.public void add(@Nonnull
com.github.javaparser.ast.comments.LineComment pComment)
pComment - The line comment to add metrics from.java.lang.NullPointerException - if pComment is null.public void add(@Nonnull
com.github.javaparser.ast.comments.BlockComment pComment)
pComment - The block comment to add metrics from.java.lang.NullPointerException - if pComment is null.public void add(@Nonnull
com.github.javaparser.ast.comments.JavadocComment pComment)
pComment - The JavaDoc comment to add metrics from.java.lang.NullPointerException - if pComment is null.