/** Full dump for debugging */ public String dump() { return rdfNode.getLocalName() + siblings.dump() + " succ=" + dumpSet(succ) + ", succClose=" + dumpSet(succClosed) + ", pred=" + dumpSet(pred); }
/** Create a list of triples for a given set of successors to this node. */ private List<Triple> triplesForSuccessors(Node base, boolean closed, TransitiveGraphCache tgc) { Set<GraphNode> successors = closed ? succClosed : succ; ArrayList<Triple> result = new ArrayList<>(successors.size() + 10); result.add(new Triple(base, tgc.closedPredicate, base)); // implicit reflexive case for (GraphNode s : successors) { result.add(new Triple(base, tgc.closedPredicate, s.rdfNode)); s.siblings.addSuccessors(base, tgc, result); } siblings.addSuccessors(base, tgc, result); return result; }
public Iterator<GraphNode> concatenateSiblings(Iterator<GraphNode> base) { return WrappedIterator.create(base).andThen(siblings.siblingIterator()); }
public Iterator<GraphNode> siblingIterator() { return siblings.siblingIterator(); }
/** * Return the lead node in the strongly connected component containing this node. It will be the * node itself if it is a singleton or the lead node. */ public GraphNode leadNode() { return siblings.leadNode(this); }
// should only be called on a lead node private Set<GraphNode> siblings() { return siblings.members(); }