QuicTimedEvent instances are designed to be
registered with a single QuicTimerQueue.
Implementation Specification
Implementations should make sure that each instance of
QuicTimedEvent is only present once in a single
QuicTimerQueue at any given time. It is however
allowed to register the event again with the same QuicTimerQueue
after it has been handled, or if it is no longer registered in any
queue.
| Modifier and Type | Field and Description |
|---|---|
| public static final Comparator | COMPARATOR
A comparator that compares |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: whether the first element is less, same, or greater than the second.a first QuicTimedEvent instance one, QuicTimedEvent a second QuicTimedEvent instance two)Compares two instance of |
| public default int | Returns: -1, 0, or 1 depending on whether this
event's deadline is before, equals to, or after, the other event's
deadline.the other event other)Compares this event's deadline with the other event's deadline. |
| public Deadline | Returns: the deadline at which the event should be triggered, orDeadline#MAX if the event does not need
to be scheduledReturns the deadline at which the event should be triggered,
or |
| public long | Returns: this event's id.An event id, obtained at construction time from
|
| public Deadline | Returns: a new deadline if the event should be rescheduled right away,Deadline.MAX
otherwise.Handles the triggered event. |
| public default boolean | Returns: true if this event's deadline is before the other's event deadlinethe other event other)Returns true if this event's deadline is before the other's event deadline. |
| public Deadline |
| COMPARATOR | back to summary |
|---|---|
| public static final Comparator<QuicTimedEvent> COMPARATOR A comparator that compares | |
| compare | back to summary |
|---|---|
| public static int compare(QuicTimedEvent one, QuicTimedEvent two) Compares two instance of
| |
| compareDeadlines | back to summary |
|---|---|
| public default int compareDeadlines(QuicTimedEvent other) Compares this event's deadline with the other event's deadline. Implementation Specification The default implementation of this method compares deadlines in the same manner as
| |
| deadline | back to summary |
|---|---|
| public Deadline deadline() Returns the deadline at which the event should be triggered,
or Implementation Specification Care should be taken to not change the deadline while the
event is registered with a
| |
| eventId | back to summary |
|---|---|
| public long eventId() An event id, obtained at construction time from
| |
| handle | back to summary |
|---|---|
| public Deadline handle() Handles the triggered event.
Returns a new deadline, if the event needs to be
rescheduled, or Implementation Specification The
| |
| isBefore | back to summary |
|---|---|
| public default boolean isBefore(QuicTimedEvent other) Returns true if this event's deadline is before the other's event deadline. Implementation Specification The default implementation of this method is to return
| |
| refreshDeadline | back to summary |
|---|---|
| public Deadline refreshDeadline() Called to cause an event to refresh its deadline.
This method is called by the API Note The value returned by | |