org.hibernate.search.query.fieldcache
Class IntFieldLoadingStrategy
java.lang.Object
org.hibernate.search.query.fieldcache.IntFieldLoadingStrategy
- All Implemented Interfaces:
- FieldLoadingStrategy
public final class IntFieldLoadingStrategy
- 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
Method Summary |
Integer |
collect(int relativeDocId)
The collector wants to pick a specific element from the cache. |
void |
loadNewCacheValues(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 |
IntFieldLoadingStrategy
public IntFieldLoadingStrategy(String fieldName)
loadNewCacheValues
public void loadNewCacheValues(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 Integer 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