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

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

源代码:

第一个类:divDTO

publicclassdivDTO

{

privateintdivBase;

privateintlength;

privateintdivFlag;

publicdivDTO(intdivBase,intlength,intdivFlag) {

this.divBase=divBase;

this.divFlag=divFlag;

this.length=length;

}

publicdivDTO()

{

}

{

this.divBase=base;

}

publicintgetDivBase()

{

returnthis.divBase;

}

publicvoidsetLength(intlength) {

this.length=length;

}

publicintgetLength()

{

returnthis.length;

}

{

this.divFlag=flag;

}

publicintgetDivFalg()

{

returnthis.divFlag;

}

}

2.第二个类:PcbDTO publicclassPcbDTO

{

staticfinalintRunning=1;

staticfinalintReady=2;

staticfinalintWaiting=3;

privateStringprocessName;

privateintrunTime;

privateintprority;

privateintprocessState;

privateintbase;

privateintlimit;

privateintpcbFlag;

publicPcbDTO(Stringname,inttime,intpro,intbase,intlimit) {

this.processName=name;

this.runTime=time;

this.prority=pro;

this.processState=0;

this.limit=limit;

this.base=base;

}

publicPcbDTO()

{this.pcbFlag=0;} publicvoidsetProcessName(Stringname) {

this.processName=name;

}

publicStringgetProcessName()

{

returnprocessName;

}

publicvoidsetRunTime(inttime)

{

this.runTime=time;

}

publicintgetRunTime()

{

returnthis.runTime;

}

publicvoidsetPrority(intprority)

{

this.prority=prority;

}

publicintgetPrority()

{

returnthis.prority;

}

publicvoidsetProcessState(intstate) {

this.processState=state;

}

publicStringgetProcessState()

{

Strings=newString();

if(this.processState==1)

{

s="running";

}

elseif(this.processState==2)

{

s="ready";

}

elseif(this.processState==3)

{

s="waiting";

}

returns;

}

publicintgetBase()

{

returnthis.base;

}

publicvoidsetBase(intbase)

{

this.base=base;

}

publicvoidsetLimit(intlimit)

{

this.limit=limit;

}

publicintgetLimit()

{

returnthis.limit;

}

}

第三个类:主类

importjavax.swing.*; importjava.util.*; importjava.awt.*; publicclassMainFrame

{

privateJListreadyList;

privateJListwaitingList;

privateJListjobList;

privateJButtonsusButton;

privateJButtonrelaxButton;

privateJButtonstartButton;

privateJButtonnewButton;

privateJLabelnameLabel;

privateJLabelprorityLabel;

privateJLabeltimeLabel;

privateJLabeljobLabel;

相关文档
最新文档