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

上传人:E**** 文档编号:99884581 上传时间:2019-09-21 格式:DOC 页数:24 大小:262.19KB
返回 下载 相关 举报
操作系统实验进程调度和内存管理java语言版本资料_第1页
第1页 / 共24页
操作系统实验进程调度和内存管理java语言版本资料_第2页
第2页 / 共24页
操作系统实验进程调度和内存管理java语言版本资料_第3页
第3页 / 共24页
操作系统实验进程调度和内存管理java语言版本资料_第4页
第4页 / 共24页
操作系统实验进程调度和内存管理java语言版本资料_第5页
第5页 / 共24页
点击查看更多>>
资源描述

《操作系统实验进程调度和内存管理java语言版本资料》由会员分享,可在线阅读,更多相关《操作系统实验进程调度和内存管理java语言版本资料(24页珍藏版)》请在金锄头文库上搜索。

1、源代码:第一个类:divDTOpublic class divDTOprivate 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()r

2、eturn 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.第二个类:PcbDTOpublic class PcbDTOstatic final int Running = 1;static final int Ready = 2;sta

3、tic 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;t

4、his.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;publ

5、ic 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

6、(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()return this.limit;第三个类:主类import javax.swing.*;import java.util.*;import java.awt.*;import java.awt.eve

7、nt.*;import javax.swing.event.*;public class MainFrameprivate JList readyList;private JList waitingList;private JList jobList;private JButton susButton;private JButton relaxButton;private JButton startButton;private JButton newButton;private JLabel nameLabel;private JLabel prorityLabel;private JLabe

8、l timeLabel;private JLabel jobLabel;private JLabel readyLabel;private JLabel waitingLabel;private JLabel runningLabel;private JLabel spaceLabel;private JLabel divLabel;private JLabel allocLabel;private JTable readyTable;private JTable runningTable;private JTable divTable;private JTable allocTable;pr

9、ivate JTextField nameText;private JTextField timeText;private JTextField spaceText;private JComboBox prorityCom;private JPanel newPanel;private JPanel waitingPanel;private JPanel readyPanel;Vector jobVectorName;Vector jobDtoVector;Vector waitingVectorName;Vector waitingDtoVector;PcbDTO readyDtoArray

10、;PcbDTO newDtoArray;divDTO divDtoArray;PcbDTO newSort;Object readydata;Object runningdata;Object divdata;Object allocdata;int first;int end;int point;PcbDTO a ;public MainFrame()a = new PcbDTO();first = 0;end = 0;point = 0;JFrame jf = new JFrame(进程调度-ws);Container c = jf.getContentPane();c.setLayout

11、(null);/c.setBackground(Color.pink);newPanel = new JPanel();newPanel.setLayout(null);waitingPanel = new JPanel();waitingPanel.setLayout(null);/waitingPanel.setBackground(Color.pink);readyPanel = new JPanel();readyPanel.setLayout(null);susButton = new JButton(挂起);relaxButton = new JButton(释放);startBu

12、tton = new JButton(开始);newButton = new JButton(新建进程);nameLabel = new JLabel(进程名);prorityLabel = new JLabel(优先级);timeLabel = new JLabel(运行时间);jobLabel = new JLabel(后备队列);readyLabel = new JLabel(就绪队列);waitingLabel = new JLabel(等待队列);runningLabel = new JLabel(运行进程);spaceLabel = new JLabel(需要空间);divLabe

13、l = new JLabel(未分分区表);allocLabel = new JLabel(内存分配表);nameText = new JTextField();timeText = new JTextField();spaceText = new JTextField();prorityCom = new JComboBox();prorityCom.setToolTipText(优先级);readyDtoArray = new PcbDTO6;newSort = new PcbDTO6;for(int i = 0; i 6;i+)newSorti = new PcbDTO();newDtoArray = new PcbDTO100;jobDtoVector = new Vector();jobVectorName = new Vector();waitingDtoVector = new Vector();waitingVectorName = new Vector

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号