操作系统实验--进程调度和内存管理---java语言版本

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

源代码:

第一个类:divDTO

public class divDTO

{

private int divBase;

private int length;

private int divFlag;

public divDTO(int divBase,int length,int divFlag) {

this.divBase = divBase;

this.divFlag = divFlag;

this.length = length;

}

public divDTO()

{

}

public void setDivBase(int base)

{

this.divBase = base;

}

public int getDivBase()

{

return this.divBase;

}

public void setLength(int length)

{

this.length = length;

}

public int getLength()

{

return this.length;

}

public void setDivFlag(int flag)

{

this.divFlag = flag;

}

public int getDivFalg()

{

return this.divFlag;

}

}

2.第二个类:PcbDTO

public class PcbDTO

{

static final int Running = 1;

static final int Ready = 2;

static final int Waiting = 3;

private String processName;

private int runTime;

private int prority;

private int processState;

private int base;

private int limit;

private int pcbFlag;

public PcbDTO(String name, int time,int pro,int base,int limit) {

this.processName = name;

this.runTime = time;

this.prority = pro;

this.processState = 0;

this.limit = limit;

this.base = base;

}

public PcbDTO()

{this.pcbFlag = 0;}

public void setProcessName(String name)

{

this.processName = name;

}

public String getProcessName()

{

return processName;

}

public void setRunTime(int time)

{

this.runTime = time;

}

public int getRunTime()

{

return this.runTime;

}

public void setPrority(int prority) {

this.prority = prority;

}

public int getPrority()

{

return this.prority;

}

public void setProcessState(int state) {

this.processState = state;

}

public String getProcessState()

{

String s = new String();

if(this.processState == 1)

{

s = "running";

}

else if(this.processState == 2)

{

s = "ready";

}

else if(this.processState == 3)

{

s = "waiting";

}

return s;

}

public int getBase()

{

return this.base;

}

public void setBase(int base)

{

this.base = base;

}

public void setLimit(int limit)

{

this.limit = limit;

}

public int getLimit()

{

相关文档
最新文档