Exemple #1
0
 public static Map<String, List<FaunusEdge>> readFields(
     final DataInput in, final Direction idToRead, final long otherId) throws IOException {
   final Map<String, List<FaunusEdge>> edges = new HashMap<String, List<FaunusEdge>>();
   int edgeTypes = in.readShort();
   for (int i = 0; i < edgeTypes; i++) {
     final String label = in.readUTF();
     final int size = WritableUtils.readVInt(in);
     final List<FaunusEdge> temp = new ArrayList<FaunusEdge>(size);
     for (int j = 0; j < size; j++) {
       final FaunusEdge edge = new FaunusEdge();
       edge.readFieldsCompressed(in, idToRead);
       edge.setLabel(label);
       if (idToRead.equals(Direction.OUT)) edge.inVertex = otherId;
       else edge.outVertex = otherId;
       temp.add(edge);
     }
     edges.put(label, temp);
   }
   return edges;
 }