📄 keyedemployee.java
字号:
package fileMerging;
import dslib.base.KeyedUos;
import sequentialProcessing.Employee;
/** An Employee with a key, the employee number. */
public class KeyedEmployee extends Employee implements KeyedUos
{
/** Construct a new employee.
Analysis: Time = O(1) */
public KeyedEmployee(String newName, int newNumber, float newRate, String newClassification)
{
super(newName, newNumber, newRate, newClassification);
}
/** Key of the employee.
Analysis: Time = O(1) */
public Comparable key()
{
return new Integer(number);
}
/** Set the key to be newKey.
Analysis: Time = O(1)
@param newKey the new key value for the current employee */
public void setKey(Comparable newKey)
{
number = ((Integer)newKey).intValue();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -