com.artima.place
Interface KeyIterator
- public interface KeyIterator
A iterator over a potentially distributed collection of object keys.
KeyIterator supports distributed collections by including
RemoteException in the throws clauses of all its methods.
In addition, KeyIterator provides cache support via its
cachNext method, which enables clients to manage network
traffic.
|
Method Summary |
void |
cacheNext(int cacheSize)
Requests that the next cacheSize elements be cached
locally. |
boolean |
hasNext()
Returns true if the iteration has more elements. |
java.lang.Object |
next()
Returns the next element in the iteration. |
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
cacheNext
public void cacheNext(int cacheSize)
throws java.rmi.RemoteException
- 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.- Throws:
java.lang.IllegalArgumentException - if passed cacheSize is
less than or equal to zero.java.rmi.RemoteException - if a network problem prevents this method
from fulfilling its contractual obligations