Record Class DistributedPriorityQueue.PriorityKey<V>
java.lang.Object
java.lang.Record
com.loomcache.server.datastructures.DistributedPriorityQueue.PriorityKey<V>
- Enclosing class:
DistributedPriorityQueue<V>
public static record DistributedPriorityQueue.PriorityKey<V>(int priority, long sequence, V item)
extends Record
Priority entry key combining priority, value, and sequence for stable ordering.
Lower priority number = higher priority.
Sequence number ensures FIFO within same comparator bucket.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPriorityKey(int priority, long sequence, V item) Creates an instance of aPriorityKeyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.intpriority()Returns the value of thepriorityrecord component.longsequence()Returns the value of thesequencerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PriorityKey
Creates an instance of aPriorityKeyrecord class.- Parameters:
priority- the value for thepriorityrecord componentsequence- the value for thesequencerecord componentitem- the value for theitemrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
priority
public int priority()Returns the value of thepriorityrecord component.- Returns:
- the value of the
priorityrecord component
-
sequence
public long sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-