Class SingletonResults

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.List<java.lang.Object>, java.util.Set<java.lang.Object>, Lazy, LazyCollection<java.lang.Object>

    public class SingletonResults
    extends Results
    implements java.util.Set<java.lang.Object>, java.util.Collection<java.lang.Object>
    This class is equivalent to a Result object with ResultRows consisting only of single items
    Author:
    Mark Woodbridge, Richard Smith, Matthew Wakeling
    • Constructor Detail

      • SingletonResults

        public SingletonResults​(Query q,
                                ObjectStore os,
                                java.util.Map<java.lang.Object,​java.lang.Integer> sequence)
        Constructor for a SingletonResults object
        Parameters:
        q - the Query that produces this Results
        os - the ObjectStore that can be used to get results rows from
        sequence - an object representing the state of the ObjectStore, which should be quoted back to the ObjectStore when requests are made
        Throws:
        java.lang.IllegalArgumentException - if q does not return a single column
      • SingletonResults

        public SingletonResults​(ResultsBatches batches,
                                boolean optimise,
                                boolean explain,
                                boolean prefetch)
        Constructor for a SingletonResults object, given a ResultsBatches object.
        Parameters:
        batches - a ResultsBatches object that will back this new object
        optimise - true if queries should be optimised
        explain - true if queries should be explained
        prefetch - true to switch on the PrefetchManager
    • Method Detail

      • range

        public java.util.List<java.lang.Object> range​(int start,
                                                      int end)
                                               throws ObjectStoreException
        Returns a range of rows of results. Will fetch batches from the underlying ObjectStore if necessary.
        Overrides:
        range in class Results
        Parameters:
        start - the start index (inclusive)
        end - the end index (inclusive)
        Returns:
        the relevant ResultRows as a List
        Throws:
        ObjectStoreException - if an error occurs in the underlying ObjectStore
      • spliterator

        public java.util.Spliterator<java.lang.Object> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<java.lang.Object>
        Specified by:
        spliterator in interface java.lang.Iterable<java.lang.Object>
        Specified by:
        spliterator in interface java.util.List<java.lang.Object>
        Specified by:
        spliterator in interface java.util.Set<java.lang.Object>