コード例 #1
0
 public void write(DataOutput out) throws IOException {
   out.writeBoolean(isNode);
   if (node != null) {
     node.write(out);
   } else {
     contribution.write(out);
   }
 }
コード例 #2
0
 public void readFields(DataInput in) throws IOException {
   isNode = in.readBoolean();
   if (isNode) {
     node = new PageRankNode();
     node.readFields(in);
   } else {
     contribution = new Contribution();
     contribution.readFields(in);
   }
 }