51. publicvoidsetName(Stringname){
52. this.name=name;
53. }
54. publicSourcesgetMaxSources(){
55. returnmaxSources;
56. }
57. publicvoidsetMaxSources(SourcesmaxSources){
58. this.maxSources=maxSources;
59. }
60. publicSourcesgetNeedSources(){
61. returnneedSources;
62. }
63. publicvoidsetNeedSources(SourcesneedSources){
64. this.needSources=needSources;
65. }
66. publicSourcesgetAllSources(){
67. returnallSources;
68. }
69. publicvoidsetAllSources(SourcesallSources){
70. this.allSources=allSources;
71. }
72. }
73. //显示当前系统和各个进程的资源使用情况
74. publicvoidshowdata(Processor[]processors){
75. //显示当前可用资源
76. System.out.print("当前系统可分配资源为:");
77. showSources(allSources);
78. System.out.println("-----------------进程状态-------------");
79. System.out.println("进程号MaxAllocationNeed
");
80. System.out.println("ABCABCABC");
81. for(inti=0;i<processors.length;i++){
82. System.out.print(processors[i].getName()+""
83. +processors[i].getMaxSources().getA()+""
84. +processors[i].getMaxSources().getB()+""
85. +processors[i].getMaxSources().getC()+"
");
86. System.out.print(processors[i].getAllSources().getA()+
""
87. +processors[i].getAllSources().getB()+""
88. +processors[i].getAllSources().getC()+"
");