FileDocCategorySizeDatePackage
Voyager2.javaAPI DocExample1437Sat Sep 12 03:01:00 BST 1998None

Voyager2

public class Voyager2 extends Object
Iteration through a remote container.
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)
This example only works with ObjectSpace Voyager(tm). Visit the Voyager homepage for more information.

    try
      {
      // create a remote list
      VSList list = new VSList( "localhost:8000" );
      new VSListIterator(); // force class loading

      // fill remote list
      list.add( "yakko" );
      list.add( "wakko" );
      list.add( "dot" );
      System.out.println( "lowercase = " + list );

      // obtain a local iterator to the remote list
      list.setVirtual( true );
      ForwardIterator iterator = list.start();
      list.setVirtual( false );

      // change all elements in remote list to uppercase
      while ( !iterator.atEnd() )
        {
        String current = (String)iterator.get();
        iterator.put( current.toUpperCase() );
        iterator.advance();
        }
      System.out.println( "uppercase = " + list );
      }
    catch ( VoyagerException ex )
      {
      System.err.println( "caught: " + ex );
      }

    Voyager.shutdown();