org.eclipse.stardust.engine.api.query
Interface QueryResult<T>

All Superinterfaces:
Collection<T>, Iterable<T>, List<T>, Serializable
All Known Implementing Classes:
AbstractQueryResult, ActivityInstances, BusinessObjects, Documents, LogEntries, Models, ParticipantWorklist, ProcessDefinitions, ProcessInstances, UserGroups, Users, UserWorklist, Worklist

public interface QueryResult<T>
extends List<T>, Serializable

Result of a Query execution. Holds retrieved items, any applying SubsetPolicy and a flag if more items would be available beyond that subset.

Version:
$Revision$
Author:
rsauer
See Also:
Query, SubsetPolicy

Method Summary
 SubsetPolicy getSubsetPolicy()
          Retrieves the subset policy this result set is based on.
 long getTotalCount()
          Gets the optionally evaluated count of all items satisfying the query this result is based on.
 long getTotalCountThreshold()
          This returns the configured threshold up to which total count is counted exactly.
 boolean hasMore()
          Indicates if there are more items available for this result set than allowed by its SubsetPolicy.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 

Method Detail

getTotalCount

long getTotalCount()
                   throws UnsupportedOperationException
Gets the optionally evaluated count of all items satisfying the query this result is based on.

As evaluating the total count is probably an expensive operation, it will only be done on request. Requesting the total count has to be done by attaching an appropriate SubsetPolicy.

If no subset policy is used, the total count of items is equal the size of the query result.

Returns:
The total count of items satisfying the query, if requested by the subset policy used.
Throws:
UnsupportedOperationException - if the evaluation of the total count was not requested
See Also:
SubsetPolicy.isEvaluatingTotalCount()

getSubsetPolicy

SubsetPolicy getSubsetPolicy()
Retrieves the subset policy this result set is based on.

Returns:
The SubsetPolicy the result set is based on.

hasMore

boolean hasMore()
Indicates if there are more items available for this result set than allowed by its SubsetPolicy.

Returns:
true if there are more items available, false if not.
See Also:
getSubsetPolicy()

getTotalCountThreshold

long getTotalCountThreshold()
This returns the configured threshold up to which total count is counted exactly. If this value is exceeded then #getTotalCount() will return {Long.MAX_VALUE)

Returns:
{Long.MAX_VALUE} if no threshold value is configured. Otherwise configured value.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.