Package org.intermine.api.results
Class ExportResultsIterator
- java.lang.Object
-
- 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.- Author:
- Matthew Wakeling
-
-
Field Summary
Fields Modifier and Type Field Description protected PathQuery
originatingQuery
protected Results
results
protected java.util.Iterator<java.util.List<ResultElement>>
subIter
-
Constructor Summary
Constructors Constructor Description ExportResultsIterator(PathQuery pathQuery, Query q, Results results, java.util.Map<java.lang.String,QuerySelectable> pathToQueryNode)
Constructor for ExportResultsIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List
getColumns()
Allows test to access column info.PathQuery
getQuery()
java.util.List<Path>
getViewPaths()
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.
-
-
-
Field Detail
-
subIter
protected java.util.Iterator<java.util.List<ResultElement>> subIter
-
results
protected final Results results
-
originatingQuery
protected final PathQuery originatingQuery
-
-
Constructor Detail
-
ExportResultsIterator
public ExportResultsIterator(PathQuery pathQuery, Query q, Results results, java.util.Map<java.lang.String,QuerySelectable> pathToQueryNode) throws ObjectStoreException
Constructor for ExportResultsIterator. This creates a new instance from the given ObjectStore, PathQuery, and other necessary objects.- Parameters:
pathQuery
- a PathQuery to runq
- original queryresults
- the results object created when executing the querypathToQueryNode
- a map from path in pathQuery to QuerySelectable in the generated ObjectStore query- Throws:
ObjectStoreException
- if something goes wrong executing the query
-
-
Method Detail
-
getQuery
public PathQuery getQuery()
- Returns:
- original query
-
getViewPaths
public java.util.List<Path> getViewPaths()
- Returns:
- list of paths on view
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<java.util.List<ResultElement>>
-
next
public java.util.List<ResultElement> next()
- Specified by:
next
in interfacejava.util.Iterator<java.util.List<ResultElement>>
-
remove
public void remove()
This method is not supported.- Specified by:
remove
in interfacejava.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
-
-