Package org.intermine.objectstore.query
Class SingletonResults
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Object>
-
- org.intermine.objectstore.query.Results
-
- org.intermine.objectstore.query.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
-
-
Field Summary
-
Fields inherited from class org.intermine.objectstore.query.Results
explain, immutable, lastGet, optimise, prefetch, resultsBatches, sequential
-
-
Constructor Summary
Constructors Constructor Description SingletonResults(Query q, ObjectStore os, java.util.Map<java.lang.Object,java.lang.Integer> sequence)
Constructor for a SingletonResults objectSingletonResults(ResultsBatches batches, boolean optimise, boolean explain, boolean prefetch)
Constructor for a SingletonResults object, given a ResultsBatches object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Object>
range(int start, int end)
Returns a range of rows of results.java.util.Spliterator<java.lang.Object>
spliterator()
-
Methods inherited from class org.intermine.objectstore.query.Results
asList, equals, get, getBatchNoForRow, getBatchSize, getInfo, getObjectStore, getQuery, getResultsBatches, getSequence, hashCode, isEmpty, isSingleBatch, iterator, iteratorFrom, setBatchSize, setImmutable, setNoExplain, setNoOptimise, setNoPrefetch, size, subList, toString
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
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 Resultsos
- the ObjectStore that can be used to get results rows fromsequence
- 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 objectoptimise
- true if queries should be optimisedexplain
- true if queries should be explainedprefetch
- 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 classResults
- 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 interfacejava.util.Collection<java.lang.Object>
- Specified by:
spliterator
in interfacejava.lang.Iterable<java.lang.Object>
- Specified by:
spliterator
in interfacejava.util.List<java.lang.Object>
- Specified by:
spliterator
in interfacejava.util.Set<java.lang.Object>
-
-