FileDocCategorySizeDatePackage
OrderedMap6.javaAPI DocExample1381Sat Sep 12 03:01:00 BST 1998None

OrderedMap6

public class OrderedMap6 extends Object
Accessing keys and values.
see
com.objectspace.jgl,OrderedMap
version
3.0.0
author
ObjectSpace, Inc.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    OrderedMap map = new OrderedMap( new LessString(), true );
    map.add( "cat", "Meow" );
    map.add( "ape", "Squeak" );
    map.add( "ape", "Whoop" );
    map.add( "bat", "Squeak" );
    System.out.println( "map = " + map );

    System.out.println( "Enumerate the OrderedMap" );
    Enumeration e = map.elements();
    while ( e.hasMoreElements() )
      System.out.println( e.nextElement() );
    System.out.println();

    e = map.keys();
    System.out.print( "map.keys() = " );
    while ( e.hasMoreElements() )
      System.out.print( e.nextElement() + " ");
    System.out.println();

    e = map.keys( "Squeak" );
    System.out.print( "map.keys( Squeak ) = " );
    while ( e.hasMoreElements() )
      System.out.print( e.nextElement() + " ");
    System.out.println();

    e = map.values( "ape" );
    System.out.print( "map.values( ape ) = " );
    while ( e.hasMoreElements() )
      System.out.print( e.nextElement() + " ");
    System.out.println();