📄 binaryheapelement.java
字号:
package dk.itu.nulx30.util;
/**
* This abstract class is the superclass for all elements in the binary heap.
* So all elements in the binary heap must extend this class.
*
* @author Mikkel Bundgaard
* @author Troels C. Damgaard
* @author Federico Decara
* @author Jacob W. Winther
*
* @see BinaryHeap
*/
public abstract class BinaryHeapElement {
/** The priority of this element */
private double priority;
/** The index of this element */
private int index;
/**
* This method is an accessor method for <code>priority</code>.
*
* @return the value of <code>priority</code>.
*/
public double getPriority() {
return priority;
}
/**
* <code>setPriority</code> is an mutator method for <code>priority</code>.
*
* @param newVal the new value for <code>priority</code>.
*/
public void setPriority( double newVal ) {
priority = newVal;
}
/**
* This method is an accessor method for <code>index</code>.
*
* @return the value of <code>index</code>.
*/
public int getIndex() {
return index;
}
/**
* <code>setIndex</code> is an mutator method for <code>index</code>.
*
* @param newVal the new value for <code>index</code>.
*/
public void setIndex( int newVal ) {
index = newVal;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -