org.infinispan.query.impl
Class LazyIterator

java.lang.Object
  extended by org.infinispan.query.impl.AbstractIterator
      extended by org.infinispan.query.impl.LazyIterator
All Implemented Interfaces:
Iterator<Object>, ListIterator<Object>, QueryIterator

@NotThreadSafe
public class LazyIterator
extends AbstractIterator

Implementation for QueryIterator. This is what is returned when the CacheQuery.lazyIterator() method is called. This loads the results only when required and hence differs from EagerIterator which is the other implementation of QueryResultIterator.

Author:
Navin Surtani, Marko Luksa

Field Summary
 
Fields inherited from class org.infinispan.query.impl.AbstractIterator
buffer, bufferIndex, cache, fetchSize, first, index, max
 
Constructor Summary
LazyIterator(org.hibernate.search.query.engine.spi.HSQuery hSearchQuery, AdvancedCache<?,?> cache, KeyTransformationHandler keyTransformationHandler, int fetchSize)
           
 
Method Summary
 void add(Object o)
          This method is not supported in and should not be called.
 void close()
          This method must be called on your iterator once you have finished so that Lucene resources can be freed up.
 void jumpToResult(int index)
          Jumps to a specific index in the iterator.
 Object next()
           
 int nextIndex()
           
 Object previous()
           
 int previousIndex()
           
 void remove()
          This method is not supported and should not be used.
 void set(Object o)
          This method is not supported in and should not be called.
 
Methods inherited from class org.infinispan.query.impl.AbstractIterator
afterFirst, beforeLast, first, hasNext, hasPrevious, isAfterFirst, isBeforeLast, isFirst, isLast, last
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyIterator

public LazyIterator(org.hibernate.search.query.engine.spi.HSQuery hSearchQuery,
                    AdvancedCache<?,?> cache,
                    KeyTransformationHandler keyTransformationHandler,
                    int fetchSize)
Method Detail

jumpToResult

public void jumpToResult(int index)
                  throws IndexOutOfBoundsException
Description copied from interface: QueryIterator
Jumps to a specific index in the iterator.

Parameters:
index - index to jump to.
Throws:
IndexOutOfBoundsException - if the index is out of bounds

close

public void close()
Description copied from interface: QueryIterator
This method must be called on your iterator once you have finished so that Lucene resources can be freed up.


next

public Object next()

previous

public Object previous()

nextIndex

public int nextIndex()

previousIndex

public int previousIndex()

remove

public void remove()
This method is not supported and should not be used. Use cache.remove() instead.


set

public void set(Object o)
         throws UnsupportedOperationException
This method is not supported in and should not be called. Use cache.put() instead.

Parameters:
o -
Throws:
UnsupportedOperationException

add

public void add(Object o)
This method is not supported in and should not be called. Use cache.put() instead.

Parameters:
o -
Throws:
UnsupportedOperationException

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.