com.artima.place
Interface DistributedIterator


public interface DistributedIterator

An iterator over a potentially distributed collection of object. DistributedIterator supports distributed collections by including RemoteException in the throws clauses of all its methods. In addition, DistributedIterator provides cache support via its overloaded next method that takes an int cacheNext parameter, which enables clients of the DistributedIterator to manage network traffic.


Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 java.lang.Object next(int cacheSize)
          Returns the next element in the iteration and requests that the next cacheSize elements be cached locally.
 

Method Detail

hasNext

public boolean hasNext()
                throws java.rmi.RemoteException
Returns true if the iteration has more elements.
Returns:
true if the iteration has more elements.
Throws:
java.rmi.RemoteException - if a network problem prevents this method from fulfilling its contractual obligations

next

public java.lang.Object next()
                      throws java.rmi.RemoteException
Returns the next element in the iteration.
Returns:
the next key in the iteration
Throws:
java.rmi.RemoteException - if a network problem prevents this method from fulfilling its contractual obligations
java.util.NoSuchElementException - if the iteration has no more elements

next

public java.lang.Object next(int cacheSize)
                      throws java.rmi.RemoteException
Returns the next element in the iteration and requests that the next cacheSize elements be cached locally. Any elements remaining in the iteration, up to the passed cacheSize, that have not yet been downloaded across the network will be downloaded when this method is invoked.
Parameters:
cacheSize - the number of elements to cache locally.
Returns:
the next key in the iteration
Throws:
java.lang.IllegalArgumentException - if passed cacheNext is less than or equal to zero.
java.rmi.RemoteException - if a network problem prevents this method from fulfilling its contractual obligations
java.util.NoSuchElementException - if the iteration has no more elements