org.trippi.impl.kowari
Class KowariTupleIterator

java.lang.Object
  extended by org.trippi.TupleIterator
      extended by org.trippi.impl.kowari.KowariTupleIterator

public class KowariTupleIterator
extends TupleIterator

A TupleIterator that wraps a Kowari Answer object containing tuples.

Author:
cwilper@cs.cornell.edu

Field Summary
 
Fields inherited from class org.trippi.TupleIterator
INPUT_FORMATS, OUTPUT_FORMATS
 
Constructor Summary
KowariTupleIterator(org.kowari.query.Answer answer)
          Initialize the iterator given a Kowari Answer.
 
Method Summary
 void close()
          Release resources held by this TupleIterator.
 void finalize()
          Ensure close() gets called at garbage collection time.
 boolean hasNext()
          Return true if there are more results.
 java.lang.String[] names()
          Get the names of the binding variables.
 java.util.Map next()
          Return the next result.
 
Methods inherited from class org.trippi.TupleIterator
count, fromStream, main, nextTriples, setAliasMap, toStream
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KowariTupleIterator

public KowariTupleIterator(org.kowari.query.Answer answer)
                    throws TrippiException
Initialize the iterator given a Kowari Answer.

Throws:
TrippiException - if there is an error positioning to the first result.
Method Detail

hasNext

public boolean hasNext()
Description copied from class: TupleIterator
Return true if there are more results.

Specified by:
hasNext in class TupleIterator

next

public java.util.Map next()
                   throws TrippiException
Description copied from class: TupleIterator
Return the next result.

Specified by:
next in class TupleIterator
Throws:
TrippiException

names

public java.lang.String[] names()
Description copied from class: TupleIterator
Get the names of the binding variables. These will be the keys in the map for result.

Specified by:
names in class TupleIterator

close

public void close()
           throws TrippiException
Description copied from class: TupleIterator
Release resources held by this TupleIterator.

Specified by:
close in class TupleIterator
Throws:
TrippiException

finalize

public void finalize()
              throws TrippiException
Ensure close() gets called at garbage collection time.

Overrides:
finalize in class TupleIterator
Throws:
TrippiException