📄 proc.java
字号:
//
// This class implements a Process for the simulation
//
// A process has two parameters:
// the process duration, timeLeft;
// the process name, procName.
//
public class proc
{
private int timeLeft; ////the time left
private String procName; ////the name of the process
private int creationTime; ////the creation time
private int lasttime=0;
// Constructor for Proc class.
// Requires the process duration and a process name
// The creation time is read directly from the Clock thread.
//// constructor
proc(int time, String name) ////assign name and cpu burst
{
timeLeft = time;
procName = name;
creationTime = 0; ////the create time is decided by clock
this.lasttime=0;
}
public int getlasttime()
{
return this.lasttime;
}
public void setlasttime(int lasttime)
{
this.lasttime=lasttime;
}
// Accesor method to read the time of process creation
public int getCreation() ////get creation time
{
return creationTime;
}
// Accesor method to read timeLeft
public int getTime() ////get the left time
{
return timeLeft;
}
// Accesor method to modify timeLeft
public void setTime(int newTime) ////set the left time
{
timeLeft = newTime;
}
// Accesor method to read procName
public String getName() ////get the name of the process
{
return procName;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -