K
- Type of the keys to which timers are scoped.N
- Type of the namespace to which timers are scoped.@Internal public final class TimerHeapInternalTimer<K,N> extends Object implements InternalTimer<K,N>, HeapPriorityQueueElement
InternalTimer
to use with a HeapPriorityQueueSet
.KEY_EXTRACTOR_FUNCTION, TIMER_COMPARATOR
NOT_CONTAINED
Constructor and Description |
---|
TimerHeapInternalTimer(long timestamp,
K key,
N namespace) |
Modifier and Type | Method and Description |
---|---|
int |
comparePriorityTo(InternalTimer<?,?> other) |
boolean |
equals(Object o) |
int |
getInternalIndex()
Returns the current index of this object in the internal array of
HeapPriorityQueue . |
K |
getKey()
Returns the key that is bound to this timer.
|
N |
getNamespace()
Returns the namespace that is bound to this timer.
|
long |
getTimestamp()
Returns the timestamp of the timer.
|
int |
hashCode() |
void |
setInternalIndex(int newIndex)
Sets the current index of this object in the
HeapPriorityQueue and should only be
called by the owning HeapPriorityQueue . |
String |
toString() |
public long getTimestamp()
InternalTimer
getTimestamp
in interface InternalTimer<K,N>
@Nonnull public K getKey()
InternalTimer
@Nonnull public N getNamespace()
InternalTimer
getNamespace
in interface InternalTimer<K,N>
public int getInternalIndex()
HeapPriorityQueueElement
HeapPriorityQueue
.getInternalIndex
in interface HeapPriorityQueueElement
public void setInternalIndex(int newIndex)
HeapPriorityQueueElement
HeapPriorityQueue
and should only be
called by the owning HeapPriorityQueue
.setInternalIndex
in interface HeapPriorityQueueElement
newIndex
- the new index in the timer heap.public int comparePriorityTo(@Nonnull InternalTimer<?,?> other)
comparePriorityTo
in interface PriorityComparable<InternalTimer<?,?>>
PriorityComparator.comparePriority(Object, Object).
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.