org.hibernate.search.query.fieldcache.impl
Class LongFieldLoadingStrategy

java.lang.Object
  extended by org.hibernate.search.query.fieldcache.impl.LongFieldLoadingStrategy
All Implemented Interfaces:
FieldLoadingStrategy

public final class LongFieldLoadingStrategy
extends Object
implements FieldLoadingStrategy

We need a collection of similar implementations, one per each FieldCache.DEFAULT.accessmethod to be able to deal with arrays of primitive values without autoboxing all of them.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.
See Also:
FieldLoadingStrategy

Constructor Summary
LongFieldLoadingStrategy(String fieldName)
           
 
Method Summary
 Long collect(int relativeDocId)
          The collector wants to pick a specific element from the cache.
 void loadNewCacheValues(org.apache.lucene.index.IndexReader reader)
          A new IndexReader is opened - implementations usually need this to load the next array of cached data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongFieldLoadingStrategy

public LongFieldLoadingStrategy(String fieldName)
Method Detail

loadNewCacheValues

public void loadNewCacheValues(org.apache.lucene.index.IndexReader reader)
                        throws IOException
Description copied from interface: FieldLoadingStrategy
A new IndexReader is opened - implementations usually need this to load the next array of cached data.

Specified by:
loadNewCacheValues in interface FieldLoadingStrategy
Parameters:
reader - the IndexReader for which to load the new cache values
Throws:
IOException - in case an error occurs reading the cache values from the index

collect

public Long collect(int relativeDocId)
Description copied from interface: FieldLoadingStrategy
The collector wants to pick a specific element from the cache. Only at this point we convert primitives into an object if needed.

Specified by:
collect in interface FieldLoadingStrategy
Parameters:
relativeDocId - the doc id relative to the current reader
Returns:
the cached field value for the document with the relative id relativeDocId.


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved