/** * Returns the node metrics at a given index. * If there is no entry at the given index it is created by this call. */ private NodeMetrics getNodeMetrics(Mirror.Entry entry) { int index = getIndex(entry.getName()); // expand node array as needed while (nodeWeights.size() < (index + 1)) nodeWeights.add(null); NodeMetrics nodeMetrics = nodeWeights.get(index); if (nodeMetrics == null) { // initialize statistics for this node nodeMetrics = new NodeMetrics("node_" + index, metrics.targets); nodeWeights.set(index, nodeMetrics); } return nodeMetrics; }