Public Types | |
enum | MyStats { SendRequests = ("packets", "The number of packets sent"), RecvMessages = ("packets", "The number of packets received"), SendRate = ("packets per second", "The 5 minute moving average of packet/sec transmits") } |
Public Member Functions | |
void | send (Object o) |
void | recv (Object o) |
CCNStats | getStats () |
Implement the IStatsEnum interface. | |
Package Attributes | |
CCNEnumStats< MyStats > | _stats = new CCNEnumStats<MyStats>(MyStats.SendRequests) |
Instantiate our stats counter. |
CCNEnumStats<MyStats> org.ccnx.ccn.impl.CCNStats.ExampleClassWithStatistics._stats = new CCNEnumStats<MyStats>(MyStats.SendRequests) [package] |
Instantiate our stats counter.
Note that we need to pass a Java generic type for our Enum and then pass an instance of the Enum to the constructor. It does not matter which enum value we pass to the constructor, it just needs a concrete object it can reference.