Class QueryResults

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<QueryResults.Row>, java.util.Collection<QueryResults.Row>, java.util.List<QueryResults.Row>

    public class QueryResults
    extends java.util.AbstractList<QueryResults.Row>
    implements java.io.Serializable

    This object represents the results of a query / nested query structure generated by a report's query datasource. The query results are stored in the "coreResults" dataset field, and any nested queries are stored in a map of dataKey -> QueryResults

    It is constructed to be java.io.serializable and reportmill-friendly (meaning, it is a java.util.List<RMKey.Get>)

    Created by carl.gould on 2/3/2015.

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  QueryResults.Row
      Each row implements RMKey.Get, which knows how to retrieve a value based on column name
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addNestedQueryResults​(java.lang.String key, QueryResults[] results)
      Add results from a nested query.
      QueryResults.Row get​(int index)  
      Dataset getCoreResults()
      Get the results of the "core" query that created this object.
      java.util.TreeMap<java.lang.String,​QueryResults[]> getNestedQueryResults()
      Get the nested query results
      java.lang.Object lookup​(int rowIndex, java.lang.String keyName)  
      int size()  
      • Methods inherited from class java.util.AbstractList

        add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Constructor Detail

      • QueryResults

        public QueryResults​(Dataset dataset)
        Create a new QueryResults with the results of a query
    • Method Detail

      • getCoreResults

        public Dataset getCoreResults()
        Get the results of the "core" query that created this object. Doesn't include nested queries
      • getNestedQueryResults

        public java.util.TreeMap<java.lang.String,​QueryResults[]> getNestedQueryResults()
        Get the nested query results
      • addNestedQueryResults

        public void addNestedQueryResults​(java.lang.String key,
                                          QueryResults[] results)
        Add results from a nested query. The length of the results array should match the size() of this list, which is the row length of the core results dataset
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<QueryResults.Row>
        Specified by:
        size in interface java.util.List<QueryResults.Row>
        Specified by:
        size in class java.util.AbstractCollection<QueryResults.Row>
      • lookup

        public java.lang.Object lookup​(int rowIndex,
                                       java.lang.String keyName)