Package ucb.util

Class Ticker

  • All Implemented Interfaces:
    Runnable

    public abstract class Ticker
    extends Object
    implements Runnable
    A simple timer class that periodically performs some action.
    • Constructor Detail

      • Ticker

        public Ticker​(long interval)
        A Ticker that, when started, fires every INTERVAL milliseconds, or never, if interval <= 0.
    • Method Detail

      • start

        public void start()
        Start ticking, executing tick() at each tick.
      • stop

        public void stop()
        Stop ticking.
      • close

        public void close()
        Permanently stop THIS and terminate its thread.
      • tick

        protected abstract void tick()
        Action to perform on each clock tick. Must be overrridden.
      • run

        public void run()
        Internal method. Don't call directly.
        Specified by:
        run in interface Runnable