Class Delayer<T>


  • public class Delayer<T>
    extends java.lang.Object
    Collects actions by key and executes them - if a predicate is true - every N ms.
    Since:
    5.3.1
    Author:
    Bela Ban
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  Delayer.Entry  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<T,​Delayer.Entry> map  
      protected long timeout  
    • Constructor Summary

      Constructors 
      Constructor Description
      Delayer​(long timeout)  
    • Field Detail

      • timeout

        protected long timeout
    • Constructor Detail

      • Delayer

        public Delayer​(long timeout)
    • Method Detail

      • timeout

        public long timeout()
      • timeout

        public Delayer<T> timeout​(long t)
      • size

        public int size()
      • done

        public int done()
      • add

        public Delayer<T> add​(T key,
                              java.util.function.Predicate<T> pred,
                              java.util.function.Consumer<java.lang.Boolean> action)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object