📄 process.java
字号:
package algo;
public class process extends Thread implements Resource {
int Max[];
int Need[]=new int[kinds];
int Allocation[];
int prime=0;
String name="unnamed";
public process(){
Max=new int[kinds];
Allocation=new int[kinds];
Need=new int[kinds];
}
public void run(){
}
public process(int[] max ){
this.Max=max;
this.newNeed();
}
public process(int[] max,int[] allocation){
for(int i=0;i<kinds;i++){
if(max[i]<allocation[i]){
System.out.println("alocation["+i+"] larger than max ");
return;
}
}
if(max.length==allocation.length){
this.Max=max;
this.Allocation=allocation;
this.newNeed();
}
else
System.out.println("unfit!");
}
public void newNeed(){
for(int i=0;i<kinds;i++){
Need[i]=Max[i]-Allocation[i];
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -