public final class SnippetCounter extends Object implements Comparable<SnippetCounter>
| Modifier and Type | Class and Description |
|---|---|
static class |
SnippetCounter.Group
A group of related counters.
|
| Modifier and Type | Field and Description |
|---|---|
static SnippetCounter |
DISABLED_COUNTER |
| Constructor and Description |
|---|
SnippetCounter(SnippetCounter.Group group,
String name,
String description)
Creates a counter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int increment)
Increments the value of this counter.
|
int |
compareTo(SnippetCounter o)
Sorts counters in descending order of their values.
|
SnippetCounter.Group |
getGroup() |
void |
inc()
Increments the value of this counter.
|
String |
toString() |
long |
value()
Gets the value of this counter.
|
public static final SnippetCounter DISABLED_COUNTER
public SnippetCounter(SnippetCounter.Group group, String name, String description)
group - the group to which the counter belongs. If this is null, the newly created
counter is disabled and incrementing is a no-op.name - the name of the counterdescription - a brief comment describing the metric represented by the counterpublic int compareTo(SnippetCounter o)
compareTo in interface Comparable<SnippetCounter>public SnippetCounter.Group getGroup()
public void inc()
SnippetCounter object.public void add(int increment)
SnippetCounter object.public long value()