FileDocCategorySizeDatePackage
Sets4.javaAPI DocExample865Sat Sep 12 03:01:00 BST 1998None

Sets4

public class Sets4 extends Object

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

    // Order key-value pairs in descending lexicographical order of keys.
    // Note that "1" comes before "5".
    OrderedSet set = new OrderedSet( new GreaterString(), true );
    set.add( "10" );
    set.add( "10" );
    set.add( "5" );
    set.add( "5" );

    System.out.println( "set = " + set );
    int n = set.count( "10" );
    System.out.println( "There are " + n + " objects that match 10" );

    System.out.println( "Removing all occurrences of 10..." );
    set.remove( "10" );

    n = set.count( "10" );
    System.out.println( "There are now " + n + " objects that match 10" );
    System.out.println( "set = " + set );