Differential D3990 Diff 14072 java/src/main/java/org/softwareheritage/graph/utils/ReadLabelledGraph.java
Changeset View
Changeset View
Standalone View
Standalone View
java/src/main/java/org/softwareheritage/graph/utils/ReadLabelledGraph.java
Show All 23 Lines | public static void main(String[] args) throws IOException, ClassNotFoundException { | ||||
ArcLabelledNodeIterator.LabelledArcIterator s = it.successors(); | ArcLabelledNodeIterator.LabelledArcIterator s = it.successors(); | ||||
long dstNode; | long dstNode; | ||||
while ((dstNode = s.nextLong()) >= 0) { | while ((dstNode = s.nextLong()) >= 0) { | ||||
int[] labels = (int[]) s.label().get(); | int[] labels = (int[]) s.label().get(); | ||||
if (labels.length > 0) { | if (labels.length > 0) { | ||||
for (int label : labels) { | for (int label : labels) { | ||||
System.out.format( | System.out.format( | ||||
"%s %s %s\n", | "%s %s %s\n", | ||||
nodeMap.getSwhPID(srcNode), | nodeMap.getSWHID(srcNode), | ||||
nodeMap.getSwhPID(dstNode), | nodeMap.getSWHID(dstNode), | ||||
labelMap.get(label) | labelMap.get(label) | ||||
); | ); | ||||
} | } | ||||
} else { | } else { | ||||
System.out.format( | System.out.format( | ||||
"%s %s\n", | "%s %s\n", | ||||
nodeMap.getSwhPID(srcNode), | nodeMap.getSWHID(srcNode), | ||||
nodeMap.getSwhPID(dstNode) | nodeMap.getSWHID(dstNode) | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||