Top Description Methods
net.sf.ehcache.search

public Interface Results

Known Direct Implementers
net.sf.ehcache.search.impl.ResultsImpl, net.sf.ehcache.search.NullResults
Imports
java.util.List

Results object for an execution of a Query. Instances of this class are thread safe
Authors
teck, Greg Luck

Method Summary

Modifier and TypeMethod and Description
public List<Result>

Returns:

a List of all the matching cache entries
all
()

List containing all of the search results.

public void
discard()

Discard this query result.

public boolean

Returns:

true if this is an aggregate
hasAggregators
()

Whether the results contains aggregates

public boolean

Returns:

true if attributes are included
hasAttributes
()

Whether the Results have cache attributes included.

public boolean

Returns:

true if keys are included
hasKeys
()

Whether the Results have cache keys included.

public boolean

Returns:

true if values are included
hasValues
()

Whether the Results have cache values included.

public List<Result>

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.
range
(int
starting index to access
start
,
int
the number of results to return
count
)

Retrieve a subset of the cache results.

public int

Returns:

number of results present
size
()

Results size

Method Detail

allback to summary
public List<Result> all() throws SearchException

List containing all of the search results.

Returns:List<Result>

a List of all the matching cache entries

discardback to summary
public 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

hasAggregatorsback to summary
public boolean hasAggregators()

Whether the results contains aggregates

Returns:boolean

true if this is an aggregate

hasAttributesback to summary
public boolean hasAttributes()

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

Returns:boolean

true if attributes are included

hasKeysback to summary
public boolean hasKeys()

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

Returns:boolean

true if keys are included

hasValuesback to summary
public boolean hasValues()

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

Returns:boolean

true if values are included

rangeback to summary
public 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:int

starting index to access

count:int

the number of results to return

Returns:List<Result>

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.

sizeback to summary
public int size()

Results size

Returns:int

number of results present