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

public abstract Class BaseResult

extends Object
implements Result
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.search.Result
Known Direct Subclasses
net.sf.ehcache.search.impl.GroupedResultImpl, net.sf.ehcache.search.impl.ResultImpl, net.sf.ehcache.search.impl.AggregateOnlyResult
Imports
java.util.Collections, .HashMap, .List, .Map, net.sf.ehcache.search.Attribute, .Result, .SearchException, net.sf.ehcache.store.StoreQuery

Base result implementation
Author
teck

Field Summary

Modifier and TypeField and Description
private volatile List<Object>
private final StoreQuery

Constructor Summary

AccessConstructor and Description
public
BaseResult(StoreQuery query)

Constructor

Method Summary

Modifier and TypeMethod and Description
protected abstract Object

Returns:

attribute
basicGetAttribute
(String name)

Get the actual attribute value

protected abstract Object

Returns:

key
basicGetKey
()

Get the actual key value

protected abstract Object

Returns:

value
basicGetValue
()

Get the actual value

public List<Object>
getAggregatorResults()

Implements net.sf.ehcache.search.Result.getAggregatorResults.

Retrieve the aggregator value(s)
public <T> T
getAttribute(Attribute<T>
the attribute to retrieve
attribute
)

Implements net.sf.ehcache.search.Result.getAttribute.

Retrieve the given attribute value for this cache entry
public Object
getKey()

Implements net.sf.ehcache.search.Result.getKey.

Return the key for this cache entry.
pack-priv abstract Object
getSortAttribute(int pos)

Get attribute value for use in sorting

public Object
getValue()

Implements net.sf.ehcache.search.Result.getValue.

Return the value for this cache entry.
public void
setAggregateResults(List<Object> aggregateResults)

Set the aggregate results for this row

public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

aggregateResultsback to summary
private volatile List<Object> aggregateResults
queryback to summary
private final StoreQuery query

Constructor Detail

BaseResultback to summary
public BaseResult(StoreQuery query)

Constructor

Method Detail

basicGetAttributeback to summary
protected abstract Object basicGetAttribute(String name)

Get the actual attribute value

Returns:Object

attribute

basicGetKeyback to summary
protected abstract Object basicGetKey()

Get the actual key value

Returns:Object

key

basicGetValueback to summary
protected abstract Object basicGetValue()

Get the actual value

Returns:Object

value

getAggregatorResultsback to summary
public List<Object> getAggregatorResults() throws SearchException

Implements net.sf.ehcache.search.Result.getAggregatorResults.

Doc from net.sf.ehcache.search.Result.getAggregatorResults.

Retrieve the aggregator value(s)

Returns:List<Object>

the aggregators value as a List. The aggregator results will be in the same order they were added to the query

Exceptions
SearchException:
if no aggregators were requested in the query
getAttributeback to summary
public <T> T getAttribute(Attribute<T> attribute)

Implements net.sf.ehcache.search.Result.getAttribute.

Doc from net.sf.ehcache.search.Result.getAttribute.

Retrieve the given attribute value for this cache entry

Parameters
attribute:Attribute<T>

the attribute to retrieve

Returns:T

the attribute value, or null if there is none

getKeyback to summary
public Object getKey()

Implements net.sf.ehcache.search.Result.getKey.

Doc from net.sf.ehcache.search.Result.getKey.

Return the key for this cache entry.

Returns:Object

key object

getSortAttributeback to summary
pack-priv abstract Object getSortAttribute(int pos)

Get attribute value for use in sorting

getValueback to summary
public Object getValue() throws SearchException

Implements net.sf.ehcache.search.Result.getValue.

Doc from net.sf.ehcache.search.Result.getValue.

Return the value for this cache entry.

Returns:Object

value object. This value might be null if the value is no longer referenced by the cache (ie. a concurrent update removed this entry).

Exceptions
SearchException:
if values were not selected by the originating query
setAggregateResultsback to summary
public void setAggregateResults(List<Object> aggregateResults)

Set the aggregate results for this row

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