Class 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 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 run
        q - original query
        results - the results object created when executing the query
        pathToQueryNode - 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 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