예제 #1
0
 /** Full dump for debugging */
 public String dump() {
   return rdfNode.getLocalName()
       + siblings.dump()
       + " succ="
       + dumpSet(succ)
       + ", succClose="
       + dumpSet(succClosed)
       + ", pred="
       + dumpSet(pred);
 }
예제 #2
0
 /** 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;
 }
예제 #3
0
 public Iterator<GraphNode> concatenateSiblings(Iterator<GraphNode> base) {
   return WrappedIterator.create(base).andThen(siblings.siblingIterator());
 }
예제 #4
0
 public Iterator<GraphNode> siblingIterator() {
   return siblings.siblingIterator();
 }
예제 #5
0
 /**
  * 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);
 }
예제 #6
0
 // should only be called on a lead node
 private Set<GraphNode> siblings() {
   return siblings.members();
 }