|
Java APG, Version 1.0 Author Lowell D. Thomas Copyright © Coast to Coast Research, Inc. 2011 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.coasttocoastresearch.apg.Statistics
public class Statistics
The Statistics class is used to collect and display syntax tree node statistics. The statistics count the number of times each node was visited (hit) by the parser in its journey through the syntax tree and the result of each hit - that is, whether the node matched a phrase of the input string or not.
| Method Summary | |
|---|---|
void |
displayStats(java.io.PrintStream out,
java.lang.String type)
Displays the statistics on the output device. |
void |
displayStats(java.io.PrintStream out,
java.lang.String type,
boolean alpha)
Displays the statistics on the output device. |
void |
enableCumulate(boolean enable)
Called to enable or disable the cumulation of statistics. |
int |
getHits(java.lang.String type)
Returns the hit count for the requested node type. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void displayStats(java.io.PrintStream out,
java.lang.String type)
throws java.lang.Exception
out - the output device.type - the type of statistics to display"operators" - display node hits for all operator types except rule and UDT"rules" - display node hits for rule name nodes only"udt" - display node hits for UDT nodes onlyjava.lang.Exception - thrown if the type is none of the above.
public void displayStats(java.io.PrintStream out,
java.lang.String type,
boolean alpha)
throws java.lang.Exception
out - the output device.type - the type of statistics to display"operators" - display node hits for all operator types except rule and UDT"rules" - display node hits for rule name nodes only"udt" - display node hits for UDT nodes onlyalpha - if true, the rule or UDT nodes are displayed in alphabetical order,
if false, rule or UDT nodes are ordered descending on hit count.
java.lang.Exception - thrown if the type is none of the above.public void enableCumulate(boolean enable)
enable - if true, Statistics will cumulate statistics for all parses
of the Parser instance. If false, the statistics will be reset to zero (0)
for each parse. The default value is enable=false.
public int getHits(java.lang.String type)
throws java.lang.Exception
type - determines the type of hit count to return."match" - hit count for nodes that were matched with non-empty phrases"empty" - hit count for nodes that were matched with empty phrases"nomatch" - hit count for nodes that were did not match any phrase at all"total" - total of all hits of all of the above typesjava.lang.Exception - thrown if the type parameter is not valid
|
Java APG, Version 1.0 Author Lowell D. Thomas Copyright © Coast to Coast Research, Inc. 2011 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||