org.hibernate.search.query.collector.impl
Class TwoWayTransformingFieldCacheCollector

java.lang.Object
  extended by org.apache.lucene.search.Collector
      extended by org.hibernate.search.query.collector.impl.FieldCacheCollector
          extended by org.hibernate.search.query.collector.impl.TwoWayTransformingFieldCacheCollector

public class TwoWayTransformingFieldCacheCollector
extends FieldCacheCollector

Wraps a FieldCacheCollector in such a way that getValue(int) returns objects as transformed by a TwoWayStringBridge to transform from String form to the object.

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

Field Summary
 
Fields inherited from class org.hibernate.search.query.collector.impl.FieldCacheCollector
delegate
 
Constructor Summary
TwoWayTransformingFieldCacheCollector(FieldCacheCollector delegate, TwoWayStringBridge twoWayStringBridge)
           
 
Method Summary
 void collect(int doc)
           
 Object getValue(int docId)
           
 void setNextReader(org.apache.lucene.index.IndexReader reader, int docBase)
           
 
Methods inherited from class org.hibernate.search.query.collector.impl.FieldCacheCollector
acceptsDocsOutOfOrder, setScorer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoWayTransformingFieldCacheCollector

public TwoWayTransformingFieldCacheCollector(FieldCacheCollector delegate,
                                             TwoWayStringBridge twoWayStringBridge)
Parameters:
delegate - Actually uses the delegate Collector implementation
twoWayStringBridge - Converts returned values using this TwoWayStringBridge.stringToObject(String)
Method Detail

collect

public void collect(int doc)
             throws IOException
Specified by:
collect in class FieldCacheCollector
Throws:
IOException

setNextReader

public void setNextReader(org.apache.lucene.index.IndexReader reader,
                          int docBase)
                   throws IOException
Specified by:
setNextReader in class FieldCacheCollector
Throws:
IOException

getValue

public Object getValue(int docId)
Specified by:
getValue in class FieldCacheCollector


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