📄 computestats.java
字号:
package primecruncher;import java.util.*;public class ComputeStats{ private String jobID; //private int hiInt; //private int lowInt; private Vector nodeStats=new Vector(); ComputeStats(String jobID){ this.jobID=jobID; } void addNodeStat(String nodeID,int low,int hi,long computeTime,int sentTime,int receivedTime){ nodeStats.add(new NodeStat(nodeID,low,hi,computeTime,sentTime,receivedTime)); } NodeStat[] getNodeStats(){ Vector copyStats=null; synchronized(nodeStats){ copyStats=(Vector)nodeStats.clone(); } return (NodeStat[])copyStats.toArray(new NodeStat[copyStats.size()]); } String getJobID(){ return jobID; } /** * Represent stats for a node * 为一个节点显示状态 */ /********************************************************************************/ class NodeStat{ private NodeStat(String nodeID,int low,int hi,long computeTime,int sentTime,int receivedTime){ this.nodeID=nodeID; this.low=low; this.hi=hi; this.computeTime=computeTime; this.sentTime=sentTime; this.receivedTime=receivedTime; } private String nodeID; private int low; private int hi; private long computeTime; private int sentTime; private int receivedTime; String getNodeID(){ return nodeID; } int getLow(){ return low; } int getHi(){ return hi; } long getComputeTime(){ return computeTime; } int getSentTime(){ return sentTime; } int getReceivedTime(){ return receivedTime; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -