O
- Stored object type.public class IntegerPriorityObject<O> extends Object implements PairInterface<Integer,O>, Comparable<IntegerPriorityObject<?>>
UpdatableHeap
, since hashcode and equality use the stored objects
only, not the priority.Modifier and Type | Field and Description |
---|---|
private O |
object
Stored object.
|
(package private) int |
priority
Priority.
|
Constructor and Description |
---|
IntegerPriorityObject(int priority,
O object)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IntegerPriorityObject<?> o) |
boolean |
equals(Object obj) |
Integer |
getFirst()
Get the first object - note: this may cause autoboxing, use pair.first for native pairs!
|
O |
getObject()
Get the stored object payload
|
int |
getPriority()
Get the priority.
|
O |
getSecond()
Get the second object - note: this may cause autoboxing, use pair.second for native pairs!
|
int |
hashCode() |
int priority
private O object
UpdatableHeap
s Hash Map!public IntegerPriorityObject(int priority, O object)
priority
- Priorityobject
- Payloadpublic int getPriority()
public O getObject()
public Integer getFirst()
PairInterface
getFirst
in interface PairInterface<Integer,O>
public O getSecond()
PairInterface
getSecond
in interface PairInterface<Integer,O>
public int compareTo(IntegerPriorityObject<?> o)
compareTo
in interface Comparable<IntegerPriorityObject<?>>