/** 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; }
@Override void addSuccessors(Node base, TransitiveGraphCache tgc, ArrayList<Triple> result) { for (GraphNode component : components) { result.add(new Triple(base, tgc.closedPredicate, component.rdfNode)); } }