com.neeve.query
Interface QueryResult<T>

All Superinterfaces:
Iterable<QueryResultSet.Row<T>>

public interface QueryResult<T>
extends Iterable<QueryResultSet.Row<T>>

A QueryResult is the raw output of a Query on a QueryEngine. It provides an Iterable of repository values matching a given query. This interface can be extended to provide more sophisticated views into the underlying QueryRepository.


Method Summary
 void close()
          Close the query result and any associated resources.
 int estimatedSize()
          Returns the estimated number of results represented in this QueryResult.
 QueryPlan getPlan()
          Retrieve the QueryPlan that encapsulates the execution strategy for the Query that yielded this QueryResult.
 QueryRepository<?,T> getRepository()
          Obtain the underlying QueryRepository
 String getRepositoryAlias()
          Gets the repository alias used to fetch the results.
 boolean isFullScan()
          Indicates whether the query must perform a full scan of the repository.
 void setPrefetchCount(int prefetchCount)
          Provides a hint as to the number of results that should be prefetched when iterating through the results.
 int size()
          Returns the total number of results represented in this QueryResult.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

size

int size()
Returns the total number of results represented in this QueryResult. It is not guaranteed that all queries will be able to satify this request without addtional scanning of the underlying QueryEngine.

Returns:
The total number of results represented by this QueryResult.

estimatedSize

int estimatedSize()
Returns the estimated number of results represented in this QueryResult. This is the best estimate of the size that does not require reading the underlying QueryEngine.

Returns:
The total number of results represented by this QueryResult.

isFullScan

boolean isFullScan()
Indicates whether the query must perform a full scan of the repository.


setPrefetchCount

void setPrefetchCount(int prefetchCount)
Provides a hint as to the number of results that should be prefetched when iterating through the results. This can be useful in cases where results will be displayed in pages.


getRepository

QueryRepository<?,T> getRepository()
Obtain the underlying QueryRepository

Returns:
the underlying QueryRepository

getRepositoryAlias

String getRepositoryAlias()
Gets the repository alias used to fetch the results.

Returns:
Gets the repository alias used to fetch the results.

getPlan

QueryPlan getPlan()
Retrieve the QueryPlan that encapsulates the execution strategy for the Query that yielded this QueryResult.

Returns:
The QueryPlan

close

void close()
Close the query result and any associated resources.



Copyright © 2016 Neeve Research, LLC. All Rights Reserved.