FileDocCategorySizeDatePackage
HashSet3.javaAPI DocExample1062Sat Sep 12 03:01:00 BST 1998None

HashSet3

public class HashSet3 extends Object
Counting, finding, removing.
see
com.objectspace.jgl.HashSet
version
3.0.0
author
ObjectSpace, Inc.

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

    HashSet set = new HashSet();
    set.add( "cat" );
    set.add( "ape" );
    set.add( "dog" );
    set.add( "bat" );
    System.out.println( set );
    System.out.println( "set.count( dog ) = " + set.count( "dog" ) );
    HashSetIterator i = set.find( "dog" );
    if ( i.equals( set.end() ) ) // A simpler way: if ( i.atEnd() ) ...
      System.out.println( "Could not find dog." );
    else
      System.out.println( "Found " + i.get() );
    System.out.println( "set.remove( dog ) = " + set.remove( "dog" ) );
    HashSetIterator j = set.find( "dog" );
    if ( j.atEnd() ) // A simpler way: if ( j.equals( set.end() ) ) ...
      System.out.println( "Could not find dog." );
    else
      System.out.println( "Found " + j.get() );