@NotThreadSafe public class MethodMetrics extends StatementElementMetrics
Instances of this class are not safe for use by multiple threads without external synchronization.
| Modifier and Type | Class | Description |
|---|---|---|
static class |
MethodMetrics.Kind |
The kinds of method for which metrics are collected.
|
| Constructor | Description |
|---|---|
MethodMetrics(java.lang.String pName,
MethodMetrics.Kind pKind) |
Create a new
MethodMetrics. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(TypeMetrics pLocalType) |
Add metrics for a local type to this instance.
|
MethodMetrics.Kind |
getKind() |
Get the method's kind.
|
java.lang.Iterable<TypeMetrics> |
getLocalTypes() |
Get an
Iterable that iterates over the metrics for each local type defined in the
method. |
int |
getNumLocalTypes() |
Get the number of local types defined in the method.
|
getComments, getNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetStatementspublic MethodMetrics(@Nonnull
java.lang.String pName,
@Nonnull
MethodMetrics.Kind pKind)
MethodMetrics.pName - The name of the method.pKind - The method's kind.java.lang.NullPointerException - if any of the parameters is null.@Nonnull public MethodMetrics.Kind getKind()
public int getNumLocalTypes()
@Nonnull public java.lang.Iterable<TypeMetrics> getLocalTypes()
Iterable that iterates over the metrics for each local type defined in the
method.Iterable for the local types' metrics, never null.public void add(@Nonnull
TypeMetrics pLocalType)
pLocalType - The local type metrics.java.lang.NullPointerException - if pLocalType is null.