ehcache

net.sf.ehcache.search.impl
Class BaseResult

java.lang.Object
  extended by net.sf.ehcache.search.impl.BaseResult
All Implemented Interfaces:
Result
Direct Known Subclasses:
AggregateOnlyResult, GroupedResultImpl, ResultImpl

public abstract class BaseResult
extends Object
implements Result

Base result implementation

Author:
teck

Constructor Summary
BaseResult(StoreQuery query)
          Constructor
 
Method Summary
protected abstract  Object basicGetAttribute(String name)
          Get the actual attribute value
protected abstract  Object basicGetKey()
          Get the actual key value
protected abstract  Object basicGetValue()
          Get the actual value
 List<Object> getAggregatorResults()
          Retrieve the aggregator value(s)
<T> T
getAttribute(Attribute<T> attribute)
          Retrieve the given attribute value for this cache entry
 Object getKey()
          Return the key for this cache entry.
 Object getValue()
          Return the value for this cache entry.
 void setAggregateResults(List<Object> aggregateResults)
          Set the aggregate results for this row
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseResult

public BaseResult(StoreQuery query)
Constructor

Parameters:
query -
Method Detail

setAggregateResults

public void setAggregateResults(List<Object> aggregateResults)
Set the aggregate results for this row

Parameters:
aggregateResults -

getKey

public Object getKey()
Return the key for this cache entry.

Specified by:
getKey in interface Result
Returns:
key object

basicGetKey

protected abstract Object basicGetKey()
Get the actual key value

Returns:
key

getAggregatorResults

public List<Object> getAggregatorResults()
                                  throws SearchException
Retrieve the aggregator value(s)

Specified by:
getAggregatorResults in interface Result
Returns:
the aggregators value as a List. The aggregator results will be in the same order they were added to the query
Throws:
SearchException - if no aggregators were requested in the query

getValue

public Object getValue()
                throws SearchException
Return the value for this cache entry.

Specified by:
getValue in interface Result
Returns:
value object. This value might be null if the value is no longer referenced by the cache (ie. a concurrent update removed this entry).
Throws:
SearchException - if values were not selected by the originating query

basicGetValue

protected abstract Object basicGetValue()
Get the actual value

Returns:
value

getAttribute

public <T> T getAttribute(Attribute<T> attribute)
Retrieve the given attribute value for this cache entry

Specified by:
getAttribute in interface Result
Parameters:
attribute - the attribute to retrieve
Returns:
the attribute value, or null if there is none

basicGetAttribute

protected abstract Object basicGetAttribute(String name)
Get the actual attribute value

Returns:
attribute

toString

public String toString()
Overrides:
toString in class Object

ehcache

Copyright 2001-2015, Terracotta, Inc.