FileDocCategorySizeDatePackage
ClientIterator.javaAPI DocExample2453Mon Aug 28 20:57:54 BST 2000com.imaginary.util

ClientIterator

public class ClientIterator extends Object implements Serializable, Iterator
The client portion of the distributed iterator support. This class implements the Iterator interface for a distributed iterator. Using distributed iterators, you can ship a collection across the network one element at a time, thus transmitting only the data required by the application. Furthermore, by avoiding transmitting the entire collection, you enable access to the initial elements of the collection quicker than would be possible through raw serialization of a collection.
Last modified $Date: 1999/11/06 19:50:59 $
version
$Revision: 1.2 $
author
George Reese (borg@imaginary.com)
see
com.imaginary.util.DistributedIterator

Fields Summary
private DistributedIterator
source
The remote iterator to which this client is referencing.
Constructors Summary
public ClientIterator()
Required constructor for serialization.


             
      
        super();
    
public ClientIterator(DistributedIterator src)
Constructs a new ClientIterator using the named DistributedIterator as its remote source.

param
src the server-based distributed iterator

        super();
        source = src;
    
Methods Summary
public booleanhasNext()

return
true if more elements are available in the iterator

        try {
            return source.hasNext();
        }
        catch( RemoteException e ) {
            return false;
        }
    
public java.lang.Objectnext()

return
the next element in the iterator

        try {
            Object ob = source.next();
            
            return ob;
            //return source.next();
        }
        catch( RemoteException e ) {
            e.printStackTrace();
            return null;
        }
    
public voidremove()
This operation is unsupported in this implementation.

throws
java.lang.UnsupportedOperationException always thrown

        try {
            source.remove();
        }
        catch( RemoteException e ) {
        }