Class TimerTaskList

  • All Implemented Interfaces:
    java.lang.Comparable<java.util.concurrent.Delayed>, java.lang.Iterable<TimerTask>, java.util.concurrent.Delayed

    public class TimerTaskList
    extends java.lang.Object
    implements java.util.concurrent.Delayed, java.lang.Iterable<TimerTask>
    TimerTaskList .
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  TimerTaskList.TimerTaskEntry
      The type Timer task entry.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimerTaskList​(java.util.concurrent.atomic.AtomicInteger taskCounter)
      Instantiates a new Timer task list.
    • Constructor Detail

      • TimerTaskList

        public TimerTaskList​(java.util.concurrent.atomic.AtomicInteger taskCounter)
        Instantiates a new Timer task list.
        Parameters:
        taskCounter - the task counter
    • Method Detail

      • setExpiration

        public boolean setExpiration​(long expirationMs)
        Sets expiration.
        Parameters:
        expirationMs - the expiration ms
        Returns:
        the expiration
      • getExpiration

        public long getExpiration()
        Get the bucket's expiration time.
        Returns:
        the expiration
      • foreach

        public void foreach​(java.util.function.Consumer<TimerTask> consumer)
        Traversing using this is thread-safe.
        Parameters:
        consumer - the consumer
      • getDelay

        public long getDelay​(java.util.concurrent.TimeUnit unit)
        Specified by:
        getDelay in interface java.util.concurrent.Delayed
      • compareTo

        public int compareTo​(java.util.concurrent.Delayed delayed)
        Specified by:
        compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>
      • iterator

        public java.util.Iterator<TimerTask> iterator()
        Using Iterator is not thread safe.
        Specified by:
        iterator in interface java.lang.Iterable<TimerTask>
        Returns:
        an Iterator.