@Override public void readFields(DataInput in) throws IOException { if (in.readBoolean()) { if (this.vertexID == null) { this.vertexID = GraphJobRunner.createVertexIDObject(); } this.vertexID.readFields(in); } if (in.readBoolean()) { if (this.value == null) { this.value = GraphJobRunner.createVertexValue(); } this.value.readFields(in); } this.lastComputedSuperstep = in.readLong(); this.edges = new ArrayList<Edge<V, E>>(); if (in.readBoolean()) { int num = in.readInt(); if (num > 0) { for (int i = 0; i < num; ++i) { V vertex = GraphJobRunner.createVertexIDObject(); vertex.readFields(in); E edgeCost = null; if (in.readBoolean()) { edgeCost = GraphJobRunner.createEdgeCostObject(); edgeCost.readFields(in); } Edge<V, E> edge = new Edge<V, E>(vertex, edgeCost); this.edges.add(edge); } } } votedToHalt = in.readBoolean(); readState(in); }