Class JMHSample_29_StatesDAG.Counter

  • Enclosing class:
    JMHSample_29_StatesDAG

    public static class JMHSample_29_StatesDAG.Counter
    extends java.lang.Object
    There are weird cases when the benchmark state is more cleanly described by the set of @States, and those @States reference each other. JMH allows linking @States in directed acyclic graphs (DAGs) by referencing @States in helper method signatures. (Note that JMHSample_28_BlackholeHelpers is just a special case of that. Following the interface for @Benchmark calls, all @Setups for referenced @State-s are fired before it becomes accessible to current @State. Similarly, no @TearDown methods are fired for referenced @State before current @State is done with it.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int x  
    • Constructor Summary

      Constructors 
      Constructor Description
      Counter()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      int inc()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • x

        int x
    • Constructor Detail

      • Counter

        public Counter()
    • Method Detail

      • inc

        public int inc()
      • dispose

        public void dispose()