@NotThreadSafe public class TypeMetrics extends CodeElementMetrics
| Modifier and Type | Class | Description |
|---|---|---|
static class |
TypeMetrics.Kind |
The kinds of type for which metrics are collected.
|
| Constructor | Description |
|---|---|
TypeMetrics(java.lang.String pName,
TypeMetrics.Kind pKind) |
Create a new
TypeMetrics. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(FieldMetrics pField) |
Add metrics for a field to this instance.
|
void |
add(MethodMetrics pMethod) |
Add metrics for a method to this instance.
|
void |
add(TypeMetrics pInnerType) |
Add metrics for an inner type to this instance.
|
java.lang.Iterable<FieldMetrics> |
getFields() |
Get an
Iterable that iterates over the metrics for each field defined within the
type. |
java.lang.Iterable<TypeMetrics> |
getInnerTypes() |
Get an
Iterable that iterates over the metrics for each inner type defined within
this type. |
TypeMetrics.Kind |
getKind() |
Get the type's kind.
|
java.lang.Iterable<MethodMetrics> |
getMethods() |
Get an
Iterable that iterates over the metrics for each method defined within the
type. |
int |
getNumFields() |
Get the number of fields defined within the type.
|
int |
getNumInnerTypes() |
Get the number of inner types defined within this type.
|
int |
getNumMethods() |
Get the number of methods defined within the type.
|
getComments, getNamepublic TypeMetrics(@Nonnull
java.lang.String pName,
@Nonnull
TypeMetrics.Kind pKind)
TypeMetrics.pName - The name of the type.pKind - The type's kind.java.lang.NullPointerException - if any of the parameters is null.@Nonnull public TypeMetrics.Kind getKind()
public int getNumFields()
@Nonnull public java.lang.Iterable<FieldMetrics> getFields()
Iterable that iterates over the metrics for each field defined within the
type.Iterable for the fields' metrics, never null.public int getNumMethods()
@Nonnull public java.lang.Iterable<MethodMetrics> getMethods()
Iterable that iterates over the metrics for each method defined within the
type.Iterable for the methods' metrics, never null.public int getNumInnerTypes()
@Nonnull public java.lang.Iterable<TypeMetrics> getInnerTypes()
Iterable that iterates over the metrics for each inner type defined within
this type.Iterable for the inner types' metrics, never null.public void add(@Nonnull
FieldMetrics pField)
pField - The field metrics.java.lang.NullPointerException - if pField is null.public void add(@Nonnull
MethodMetrics pMethod)
pMethod - The method metrics.java.lang.NullPointerException - if pMethod is null.public void add(@Nonnull
TypeMetrics pInnerType)
pInnerType - The inner type metrics.java.lang.NullPointerException - if pInnerType is null.