Top Description Fields Constructors Methods
net.sf.ehcache.search.impl

public Class ResultsImpl

extends Object
implements Results
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.search.Results
Imports
java.util.Collections, .List, net.sf.ehcache.search.Result, .Results, .SearchException

Results implementation
Author
teck

Field Summary

Modifier and TypeField and Description
private final Runnable
private final boolean
private final boolean
private final boolean
private final boolean
private final boolean
private final List<Result>

Constructor Summary

AccessConstructor and Description
public
ResultsImpl(List<? extends Result> results, boolean hasKeys, boolean hasValues, boolean hasAttributes, boolean hasAggregators)

Constructor

public
ResultsImpl(List<? extends Result> results, boolean hasKeys, boolean hasValues, boolean hasAttributes, boolean hasAggregators, Runnable discardCallback)

Constructor

Method Summary

Modifier and TypeMethod and Description
public List<Result>
all()

Implements net.sf.ehcache.search.Results.all.

List containing all of the search results.
public void
discard()

Implements net.sf.ehcache.search.Results.discard.

Discard this query result.
public boolean
hasAggregators()

Implements net.sf.ehcache.search.Results.hasAggregators.

Whether the results contains aggregates
public boolean
hasAttributes()

Implements net.sf.ehcache.search.Results.hasAttributes.

Whether the Results have cache attributes included.
public boolean
hasKeys()

Implements net.sf.ehcache.search.Results.hasKeys.

Whether the Results have cache keys included.
public boolean
hasValues()

Implements net.sf.ehcache.search.Results.hasValues.

Whether the Results have cache values included.
public List<Result>
range(int
starting index to access
start
,
int
the number of results to return
length
)

Implements net.sf.ehcache.search.Results.range.

Retrieve a subset of the cache results.
public int
size()

Implements net.sf.ehcache.search.Results.size.

Results size
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

discardHookback to summary
private final Runnable discardHook
emptyback to summary
private final boolean empty
hasAggregatorsback to summary
private final boolean hasAggregators
hasAttributesback to summary
private final boolean hasAttributes
hasKeysback to summary
private final boolean hasKeys
hasValuesback to summary
private final boolean hasValues
resultsback to summary
private final List<Result> results

Constructor Detail

ResultsImplback to summary
public ResultsImpl(List<? extends Result> results, boolean hasKeys, boolean hasValues, boolean hasAttributes, boolean hasAggregators)

Constructor

ResultsImplback to summary
public ResultsImpl(List<? extends Result> results, boolean hasKeys, boolean hasValues, boolean hasAttributes, boolean hasAggregators, Runnable discardCallback)

Constructor

Method Detail

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

Implements net.sf.ehcache.search.Results.all.

Doc from net.sf.ehcache.search.Results.all.

List containing all of the search results.

Returns:List<Result>

a List of all the matching cache entries

discardback to summary
public void discard()

Implements net.sf.ehcache.search.Results.discard.

Doc from net.sf.ehcache.search.Results.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()

Implements net.sf.ehcache.search.Results.hasAggregators.

Doc from net.sf.ehcache.search.Results.hasAggregators.

Whether the results contains aggregates

Returns:boolean

true if this is an aggregate

hasAttributesback to summary
public boolean hasAttributes()

Implements net.sf.ehcache.search.Results.hasAttributes.

Doc from net.sf.ehcache.search.Results.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()

Implements net.sf.ehcache.search.Results.hasKeys.

Doc from net.sf.ehcache.search.Results.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()

Implements net.sf.ehcache.search.Results.hasValues.

Doc from net.sf.ehcache.search.Results.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 length) throws SearchException

Implements net.sf.ehcache.search.Results.range.

Doc from net.sf.ehcache.search.Results.range.

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

length: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()

Implements net.sf.ehcache.search.Results.size.

Doc from net.sf.ehcache.search.Results.size.

Results size

Returns:int

number of results present

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override