- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {BufferedReader b =
InputStream in;new BufferedReader(new InputStreamReader(in))
Reader in;new BufferedReader(in)
File file;new BufferedReader(new FileReader(file))
- Smart code suggestions by Codota
}
@Override public void foundShortcut(int u_fromNode, int w_toNode, double existingDirectWeight, double existingDistSum, EdgeIterator outgoingEdges, int skippedEdge1, int incomingEdgeOrigCount) { // FOUND shortcut // but be sure that it is the only shortcut in the collection // and also in the graph for u->w. If existing AND identical weight => update setProperties. // Hint: shortcuts are always one-way due to distinct level of every node but we don't // know yet the levels so we need to determine the correct direction or if both directions Shortcut sc = new Shortcut(u_fromNode, w_toNode, existingDirectWeight, existingDistSum); if (shortcuts.containsKey(sc)) return; Shortcut tmpSc = new Shortcut(w_toNode, u_fromNode, existingDirectWeight, existingDistSum); Shortcut tmpRetSc = shortcuts.get(tmpSc); if (tmpRetSc != null) { // overwrite flags only if skipped edges are identical if (tmpRetSc.skippedEdge2 == skippedEdge1 && tmpRetSc.skippedEdge1 == outgoingEdges.getEdge()) { tmpRetSc.flags = PrepareEncoder.getScDirMask(); return; } } Shortcut old = shortcuts.put(sc, sc); if (old != null) throw new IllegalStateException("Shortcut did not exist (" + sc + ") but was overwriting another one? " + old); sc.skippedEdge1 = skippedEdge1; sc.skippedEdge2 = outgoingEdges.getEdge(); sc.originalEdges = incomingEdgeOrigCount + getOrigEdgeCount(outgoingEdges.getEdge()); } }