de.fuberlin.wiwiss.d2rq.find
Class TripleResultSet

java.lang.Object
  extended byde.fuberlin.wiwiss.d2rq.find.SQLResultSet
      extended byde.fuberlin.wiwiss.d2rq.find.TripleResultSet

public class TripleResultSet
extends SQLResultSet

Contains the result set from one SQL query and transforms it into triples. A triple is produced for TripleMaker in TripleMaker and each row in the result set.

History:
06-06-2004: Initial version of this class.
08-03-2004: Almost complete rewrite to make logic more explicit.

Version:
V0.2
Author:
Chris Bizer chris@bizer.de, Richard Cyganiak

Field Summary
private  com.hp.hpl.jena.graph.Triple chachedTriple
          The chached triple.
protected  boolean rsForward
           
private  java.util.Iterator tripleMakerIterator
           
private  java.util.ArrayList tripleMakers
          List of tripleMakers that are used on every row of the result set.
 
Fields inherited from class de.fuberlin.wiwiss.d2rq.find.SQLResultSet
columnNameNumberMap, currentRow, database, logger, numCols, protocol, queryHasBeenExecuted, separatorLogger, simulationMode, sql
 
Constructor Summary
TripleResultSet(java.lang.String SQL, java.util.Map columnNameNumberMap, Database db)
           
 
Method Summary
 void addTripleMaker(TripleQuery tripMaker)
           
 boolean hasNext()
           
 boolean hasTripleMakers()
           
 com.hp.hpl.jena.graph.Triple next()
          Returns the next triple.
 
Methods inherited from class de.fuberlin.wiwiss.d2rq.find.SQLResultSet
close, executeSQLQuery, nextRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tripleMakers

private java.util.ArrayList tripleMakers
List of tripleMakers that are used on every row of the result set.


tripleMakerIterator

private java.util.Iterator tripleMakerIterator

rsForward

protected boolean rsForward

chachedTriple

private com.hp.hpl.jena.graph.Triple chachedTriple
The chached triple. A value of null means there is no triple in the cache. A triple gets chached by hasNext() and is delivered afterwards by next().

Constructor Detail

TripleResultSet

public TripleResultSet(java.lang.String SQL,
                       java.util.Map columnNameNumberMap,
                       Database db)
Method Detail

addTripleMaker

public void addTripleMaker(TripleQuery tripMaker)

hasTripleMakers

public boolean hasTripleMakers()

hasNext

public boolean hasNext()

next

public com.hp.hpl.jena.graph.Triple next()
Returns the next triple. If there are no more triple makers for the current row of the result set then the next row is cached and the triple makers iterator is reset.

Returns:
The next triple, or null if no more triples.