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

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

public final class StringFieldLoadingStrategy
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. This particular implementation doesn't do any conversion.

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

Constructor Summary
StringFieldLoadingStrategy(String fieldName)
           
 
Method Summary
 String 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

StringFieldLoadingStrategy

public StringFieldLoadingStrategy(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 String 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