ehcache

net.sf.ehcache.search
Interface Results

All Known Implementing Classes:
NullResults, ResultsImpl

public interface Results

Results object for an execution of a Query. Instances of this class are thread safe

Author:
teck, Greg Luck

Method Summary
 List<Result> all()
          List containing all of the search results.
 void discard()
          Discard this query result.
 boolean hasAggregators()
          Whether the results contains aggregates
 boolean hasAttributes()
          Whether the Results have cache attributes included.
 boolean hasKeys()
          Whether the Results have cache keys included.
 boolean hasValues()
          Whether the Results have cache values included.
 List<Result> range(int start, int count)
          Retrieve a subset of the cache results.
 int size()
          Results size
 

Method Detail

discard

void discard()
Discard this query result. This call is not mandatory but is recommended after the caller is done with results. It can allow the cache, which may be distributed, to immediately free any resources associated with this result.

Multiple calls are ignored. Attempting to read results from this instance after this method has been called will produce SearchException


all

List<Result> all()
                 throws SearchException
List containing all of the search results.

Returns:
a List of all the matching cache entries
Throws:
SearchException

range

List<Result> range(int start,
                   int count)
                   throws SearchException,
                          IndexOutOfBoundsException
Retrieve a subset of the cache results. This method is useful when showing "paged" results in a user interface.

Parameters:
start - starting index to access
count - the number of results to return
Returns:
a List of the given size. This list will be smaller than the requested size if no more results are available. If there are no more results an empty list will be returned.
Throws:
SearchException
IndexOutOfBoundsException

size

int size()
Results size

Returns:
number of results present

hasKeys

boolean hasKeys()
Whether the Results have cache keys included. If so these can be extracted from the Result object.

Returns:
true if keys are included

hasValues

boolean hasValues()
Whether the Results have cache values included. If so these can be extracted from the Result object.

Returns:
true if values are included

hasAttributes

boolean hasAttributes()
Whether the Results have cache attributes included. If so these can be extracted from the Result object.

Returns:
true if attributes are included

hasAggregators

boolean hasAggregators()
Whether the results contains aggregates

Returns:
true if this is an aggregate

ehcache

Copyright 2001-2017, Terracotta, Inc.