Package org.zeromq.timer
Class ZTicket.Ticket
- java.lang.Object
-
- org.zeromq.timer.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.
-
-
-
Field Detail
-
parent
private final ZTicket parent
-
handler
private final TimerHandler handler
-
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.
-
compareTo
public int compareTo(ZTicket.Ticket other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ZTicket.Ticket>
-
-