⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 computestats.java

📁 由Robert Flenner,Michael Abbott,Toufic Boubez,Frand Cohen,Navaneeth Krishnan,Alan Moffet,Rajam Famamu
💻 JAVA
字号:
package primecruncher;import java.util.Vector;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 + -