FileDocCategorySizeDatePackage
OrderedMap3.javaAPI DocExample1175Sat Sep 12 03:01:00 BST 1998None

OrderedMap3

public class OrderedMap3 extends Object
Counting, finding, erasing.
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() );
    map.add( "cat", "Meow" );
    map.add( "ape", "Squeak" );
    map.add( "dog", "Woof" );
    map.add( "bat", "Squeak" );
    System.out.println( map );
    System.out.println( "map.count( dog ) = " + map.count( "dog" ) );
    OrderedMapIterator i = map.find( "dog" );
    if ( i.equals( map.end() ) ) // A simpler way: if ( i.atEnd() ) ...
      System.out.println( "Could not find dog." );
    else
      System.out.println( "Found " + i.get() );
    System.out.println( "map.remove( dog ) = " + map.remove( "dog" ) );
    OrderedMapIterator j = map.find( "dog" );
    if ( j.atEnd() ) // A simpler way: if ( j.equals( map.end() ) ) ...
      System.out.println( "Could not find dog." );
    else
      System.out.println( "Found " + j.get() );