Package minpq
Class PriorityNode<E>
- java.lang.Object
-
- minpq.PriorityNode<E>
-
-
Constructor Summary
Constructors Constructor Description PriorityNode(E element, double priority)Constructs a pair with the given element and priority.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Eelement()Returns the element.booleanequals(Object o)inthashCode()(package private) doublepriority()Returns the priority value.(package private) voidsetPriority(double priority)Reassigns the priority value for this pair.StringtoString()
-
-
-
Field Detail
-
element
private final E element
-
priority
private double priority
-
-
Constructor Detail
-
PriorityNode
PriorityNode(E element, double priority)
Constructs a pair with the given element and priority.- Parameters:
element- the element in this pair.priority- the priority value associated with the element.
-
-
Method Detail
-
element
E element()
Returns the element.- Returns:
- the element.
-
priority
double priority()
Returns the priority value.- Returns:
- the priority value.
-
setPriority
void setPriority(double priority)
Reassigns the priority value for this pair.- Parameters:
priority- the priority value to be assigned.
-
-