1 10 package com.hp.hpl.jena.reasoner.rulesys.impl; 11 12 import com.hp.hpl.jena.graph.*; 13 import com.hp.hpl.jena.util.iterator.ExtendedIterator; 14 15 26 public class TripleMatchFrame extends GenericTripleMatchFrame { 27 28 29 ExtendedIterator matchIterator; 30 31 37 public TripleMatchFrame(LPInterpreter interpreter) { 38 init(interpreter); 39 } 40 41 46 public boolean nextMatch(LPInterpreter interpreter) { 47 while (matchIterator.hasNext()) { 48 if (bindResult((Triple)matchIterator.next(), interpreter)) { 49 return true; 50 } 51 } 52 return false; 53 } 54 55 60 public void init(LPInterpreter interpreter) { 61 super.init(interpreter); 62 this.matchIterator = interpreter.getEngine().getInfGraph().findDataMatches(goal); 63 } 64 65 68 public void close() { 69 if (matchIterator != null) matchIterator.close(); 70 } 71 72 } 73 74 75 | Popular Tags |