@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected KeyValuePair<VertexWritable, VertexArrayWritable> processLine(
String line) throws IOException {
String[] split = line.split(delimiter);
ShortestPathVertex key = new ShortestPathVertex(0, split[0]);
ShortestPathVertex[] v = new ShortestPathVertex[split.length - 1];
for (int i = 1; i < split.length; i++) {
String[] weightSplit = split[i].split(edgeDelimiter);
if (weightSplit.length != 2) {
LOG.error("Adjacent vertices must contain a \"" + edgeDelimiter
+ "\" between the vertex name and the edge weight! Line was: "
+ line);
}
v[i - 1] = new ShortestPathVertex(Integer.parseInt(weightSplit[1]),
weightSplit[0]);
}
ShortestPathVertexArrayWritable value = new ShortestPathVertexArrayWritable();
value.set(v);
return new KeyValuePair(key, value);