FileDocCategorySizeDatePackage
Voyager1.javaAPI DocExample1599Sat Sep 12 03:01:00 BST 1998None

Voyager1

public class Voyager1 extends Object
Remote creation and manipulation of containers.
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 map that allows duplicate keys
      VHashMap map = new VHashMap( true, "localhost:8000" );

      // fill remote map
      map.add( "city", "Austin" );
      map.add( "song", "Texas Fight!" );
      map.add( "mascot", "Bevo" );
      map.add( "mascot", "Longhorns" );
      System.out.println( "map = " + map ); // prints locally

      // query remote container
      System.out.println( "map.size() = " + map.size() );
      System.out.println( "map.empty() = " + map.isEmpty() );
      System.out.println( "map.get( \"song\" ) = " + map.get( "song" ) );

      // mutate remote container
      map.clear();
      System.out.println( "\nafter remote map is cleared..." );
      System.out.println( "map.size() = " + map.size() );
      System.out.println( "map.empty() = " + map.isEmpty() );
      System.out.println( "map.get( \"song\" ) = " + map.get( "song" ) );
      }
    catch ( VoyagerException ex )
      {
      System.err.println( "caught: " + ex );
      }

    Voyager.shutdown();