Class StringConstructBenchmark.AppenderState

  • Enclosing class:
    StringConstructBenchmark

    public static class StringConstructBenchmark.AppenderState
    extends java.lang.Object
    A state holding an Appendable object which is initialized after a fixed number of append operations.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Appendable appender
      The appender that is currently used.
      java.lang.String appenderType
      The type of the appender to be initialised.
      int maxAppends
      The maximum number of appends before resetting the appender.
      private int nAppends
      The number of append operations performed so far.
    • Constructor Summary

      Constructors 
      Constructor Description
      AppenderState()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.Appendable getOrCreateAppender()  
      private void reset()  
      void setup()  
      • Methods inherited from class java.lang.Object

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

      • appenderType

        public java.lang.String appenderType
        The type of the appender to be initialised.
      • maxAppends

        public int maxAppends
        The maximum number of appends before resetting the appender.

        If the value is small then the appender is reinitialized very often, making the instantiation of the appender the dominant operation of the benchmark.

      • appender

        private java.lang.Appendable appender
        The appender that is currently used.
      • nAppends

        private int nAppends
        The number of append operations performed so far.
    • Constructor Detail

      • AppenderState

        public AppenderState()
    • Method Detail

      • setup

        public void setup()
      • reset

        private void reset()
      • getOrCreateAppender

        java.lang.Appendable getOrCreateAppender()