Class StopWatch.Wrapper

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable
    Enclosing class:
    StopWatch

    private static class StopWatch.Wrapper
    extends StopWatch
    Base wrapper class for other wrappers.
    • Constructor Detail

      • Wrapper

        public Wrapper​(StopWatch watch)
    • Method Detail

      • start

        public void start​(boolean reset)
        Description copied from class: StopWatch
        Start the watch.
        Overrides:
        start in class StopWatch
        Parameters:
        reset - True to reset the watch prior to starting.
      • start

        public void start()
        Description copied from class: StopWatch
        Start the watch.
        Overrides:
        start in class StopWatch
      • stop

        public long stop()
        Description copied from class: StopWatch
        Stop the watch.
        Overrides:
        stop in class StopWatch
        Returns:
        Elapsed time or 0 if the watch was never started.
      • reset

        public void reset()
        Description copied from class: StopWatch
        Reset the watch.
        Overrides:
        reset in class StopWatch
      • getLapTime

        public long getLapTime()
        Description copied from class: StopWatch
        Get the elapsed lap time since the watch was started.
        Overrides:
        getLapTime in class StopWatch
        Returns:
        Elapsed lap time or 0 if the watch was never started
      • getAverageLapTime

        public long getAverageLapTime()
        Description copied from class: StopWatch
        Get the average lap time since the watch was started.
        Overrides:
        getAverageLapTime in class StopWatch
        Returns:
        Average lap time since the watch was started.
      • getLapCount

        public int getLapCount()
        Description copied from class: StopWatch
        Get the lap count.
        Overrides:
        getLapCount in class StopWatch
        Returns:
        The lap count.
      • getTime

        public long getTime()
        Description copied from class: StopWatch
        Get the elapsed time since the watch was created or last reset.
        Overrides:
        getTime in class StopWatch
        Returns:
        Elapsed time or 0 if the watch was never started.
      • isRunning

        public boolean isRunning()
        Description copied from class: StopWatch
        Check if the watch is running.
        Overrides:
        isRunning in class StopWatch
        Returns:
        True if the watch is running.
      • toString

        public java.lang.String toString()
        Description copied from class: StopWatch
        Return a string representation.
        Overrides:
        toString in class StopWatch