org.intermine.api.results
Class ExportResultsIterator

java.lang.Object
  extended by org.intermine.api.results.ExportResultsIterator
All Implemented Interfaces:
java.util.Iterator<java.util.List<ResultElement>>

public class ExportResultsIterator
extends java.lang.Object
implements java.util.Iterator<java.util.List<ResultElement>>

An Iterator that produces data in a format suitable for exporting. The data is flattened, so if there are outer joined collections, there may be more rows than in the original results.


Constructor Summary
ExportResultsIterator(ObjectStore os, PathQuery pq, java.util.Map savedBags, BagQueryRunner bagQueryRunner)
          Constructor for ExportResultsIterator.
ExportResultsIterator(ObjectStore os, PathQuery pq, java.util.Map savedBags, BagQueryRunner bagQueryRunner, int batchSize)
          Constructor for ExportResultsIterator.
 
Method Summary
protected  java.util.List getColumns()
          Allows test to access column info.
 void goFaster()
          Switches on the goFaster mode in the objectstore for this query.
 boolean hasNext()
          
 java.util.List<ResultElement> next()
          
 void releaseGoFaster()
          Switches off the goFaster mode in the objectstore for this query.
 void remove()
          This method is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExportResultsIterator

public ExportResultsIterator(ObjectStore os,
                             PathQuery pq,
                             java.util.Map savedBags,
                             BagQueryRunner bagQueryRunner)
                      throws ObjectStoreException
Constructor for ExportResultsIterator. This creates a new instance from the given ObjectStore, PathQuery, and other necessary objects.

Parameters:
os - an ObjectStore that the query will be run on
pq - a PathQuery to run
savedBags - a Map of the bags that the query may have used
bagQueryRunner - a BagQueryRunner for any LOOKUP constraints
Throws:
ObjectStoreException - if something goes wrong executing the query

ExportResultsIterator

public ExportResultsIterator(ObjectStore os,
                             PathQuery pq,
                             java.util.Map savedBags,
                             BagQueryRunner bagQueryRunner,
                             int batchSize)
                      throws ObjectStoreException
Constructor for ExportResultsIterator. This creates a new instance from the given ObjectStore, PathQuery, and other necessary objects.

Parameters:
os - an ObjectStore that the query will be run on
pq - a PathQuery to run
savedBags - a Map of the bags that the query may have used
bagQueryRunner - a BagQueryRunner for any LOOKUP constraints
batchSize - the batch size for the results
Throws:
ObjectStoreException - if something goes wrong executing the query
Method Detail

hasNext

public boolean hasNext()

Specified by:
hasNext in interface java.util.Iterator<java.util.List<ResultElement>>

next

public java.util.List<ResultElement> next()

Specified by:
next in interface java.util.Iterator<java.util.List<ResultElement>>

remove

public void remove()
This method is not supported.

Specified by:
remove in interface java.util.Iterator<java.util.List<ResultElement>>

goFaster

public void goFaster()
Switches on the goFaster mode in the objectstore for this query.

Throws:
java.lang.RuntimeException - if something goes wrong

releaseGoFaster

public void releaseGoFaster()
Switches off the goFaster mode in the objectstore for this query.

Throws:
java.lang.RuntimeException - if something goes wrong

getColumns

protected java.util.List getColumns()
Allows test to access column info.

Returns:
columns