Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我理解得很好,一个 EdgeIterator 只能使用一次。如果这是正确的,为什么我们不能简单地重置它以避免每次我们需要在相同的节点边上循环时创建一个新的 EdgeIterator 实例?
谢谢 !
如果你使用 EdgeExplorer,EdgeIterator 会被重用:
// store somewhere explorer = graph.createEdgeExplorer(); // use somewhere EdgeIterator iter = explorer.setBaseNode(x); while(iter) {..}
仍然要非常小心,因为每个线程和每个循环都需要一个 edgeExplorer,例如,一个资源管理器的双 for-loop 将失败:)