public class Counter extends Object
You should not expect the counts to be exactly reproducible when doing the same compilation multiple times. Some objects may get garbage collected and recreated.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
COUNT_DEFINITIONS
Flag that enables counting of instances of DefinitionBase.
|
static boolean |
COUNT_NODES
Flag that enables counting of instances of NodeBase.
|
static boolean |
COUNT_SCOPES
Flag that enables counting of instances of ASScopeBase.
|
static boolean |
COUNT_TOKENS
Flag that enables counting of instances of TokenBase.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
decrementCount(String name)
Decrements the count with the specified name.
|
void |
dumpCounts()
Dumps all counts in alphabetical order to System.out.
|
int |
getCount(String name)
Gets the count with the specified name.
|
static Counter |
getInstance()
Gets the singleton instance of this class.
|
boolean |
incrementCount(String name)
Increments the count with the specified name.
|
void |
reset()
Resets the counter so that there are no named counts.
|
public static final boolean COUNT_TOKENS
public static final boolean COUNT_NODES
public static final boolean COUNT_DEFINITIONS
public static final boolean COUNT_SCOPES
public static Counter getInstance()
public void reset()
public boolean incrementCount(String name)
public boolean decrementCount(String name)
public int getCount(String name)
public void dumpCounts()
Copyright © 2016 The Apache Software Foundation. All rights reserved.