public final Map<Object, ModuleFactory> getDependencies( final ModuleFactory f, final NodeState state) { final Set<DepLink> outgoingEdges = this.graph.outgoingEdgesOf(f); final Map<Object, ModuleFactory> res = new HashMap<Object, ModuleFactory>(outgoingEdges.size()); for (final DepLink l : outgoingEdges) { if (state == null || getState(l.getTarget()) == state) res.put(l.getDepID(), l.getTarget()); } return res; }
private void walk(final ModuleFactory node, final List<ModuleFactory> res) { if (!res.contains(node)) { for (final DepLink l : this.graph.outgoingEdgesOf(node)) { this.walk(l.getTarget(), res); } res.add(node); } }
private void removeRec(ModuleFactory f) { this.checkFrozen(); this.solved.remove(f); this.solving.remove(f); // copy live view final Set<DepLink> incomingEdges = new HashSet<DepLink>(this.graph.incomingEdgesOf(f)); this.graph.removeVertex(f); for (final DepLink l : incomingEdges) { final ModuleFactory src = l.getSource(); assert l.getTarget() == f; this.removeRec(src); } }
public ModuleFactory getDependency(final ModuleFactory f, final Object id) { for (final DepLink l : this.graph.outgoingEdgesOf(f)) { if (l.getDepID().equals(id)) return l.getTarget(); } return null; }