org.infinispan.query.impl
Class EagerIterator

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

@NotThreadSafe
public class EagerIterator
extends AbstractIterator

This is the implementation class for the interface QueryResultIterator which extends ListIterator. It is what is returned when the CacheQuery.iterator().

Author:
Navin Surtani

Field Summary
 
Fields inherited from class org.infinispan.query.impl.AbstractIterator
buffer, bufferIndex, cache, fetchSize, first, index, max
 
Constructor Summary
EagerIterator(List<Object> idList, AdvancedCache<?,?> cache, 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 given index in the list of results.
 Object next()
          Returns the next element in the list
 int nextIndex()
          Returns the index of the element that would be returned by a subsequent call to next.
 Object previous()
          Returns the previous element in the list.
 int previousIndex()
          Returns the index of the element that would be returned by a subsequent call to previous.
 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

EagerIterator

public EagerIterator(List<Object> idList,
                     AdvancedCache<?,?> cache,
                     int fetchSize)
Method Detail

jumpToResult

public void jumpToResult(int index)
                  throws IndexOutOfBoundsException
Jumps to a given index in the list of results.

Parameters:
index - to jump to
Throws:
IndexOutOfBoundsException

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()
Returns the next element in the list

Returns:
The next element in the list.

previous

public Object previous()
Returns the previous element in the list.

Returns:
The previous element in the list.

nextIndex

public int nextIndex()
Returns the index of the element that would be returned by a subsequent call to next.

Returns:
Index of next element.

previousIndex

public int previousIndex()
Returns the index of the element that would be returned by a subsequent call to previous.

Returns:
Index of previous element.

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 © 2011 JBoss, a division of Red Hat. All Rights Reserved.