Class ZTicket.Ticket

  • All Implemented Interfaces:
    java.lang.Comparable<ZTicket.Ticket>
    Enclosing class:
    ZTicket

    public static final class ZTicket.Ticket
    extends java.lang.Object
    implements java.lang.Comparable<ZTicket.Ticket>
    Opaque representation of a ticket.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Ticket​(ZTicket parent, long now, long delay, TimerHandler handler, java.lang.Object... args)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean cancel()
      Cancels a ticket.
      int compareTo​(ZTicket.Ticket other)  
      void reset()
      Resets the ticket.
      void setDelay​(long delay)
      Changes the delay of the ticket.
      • Methods inherited from class java.lang.Object

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

      • parent

        private final ZTicket parent
      • args

        private final java.lang.Object[] args
      • start

        private long start
      • delay

        private long delay
      • alive

        private boolean alive
    • Constructor Detail

      • Ticket

        private Ticket​(ZTicket parent,
                       long now,
                       long delay,
                       TimerHandler handler,
                       java.lang.Object... args)
    • Method Detail

      • reset

        public void reset()
        Resets the ticket.
      • cancel

        public boolean cancel()
        Cancels a ticket.
        Returns:
        true if cancelled, false if already cancelled.
      • setDelay

        public void setDelay​(long delay)
        Changes the delay of the ticket.
        Parameters:
        delay - the new delay of the ticket.