FileDocCategorySizeDatePackage
HashSet2.javaAPI DocExample1264Sat Sep 12 03:01:00 BST 1998None

HashSet2

public class HashSet2 extends Object
Union, intersection, difference, symmetric difference, subset.
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 set1 = new HashSet();
    set1.add( "ape" );
    set1.add( "cat" );
    set1.add( "bat" );

    HashSet set2 = new HashSet();
    set2.add( "bat" );
    set2.add( "fox" );
    set2.add( "ape" );
    System.out.println( "set1 = " + set1 + ", set2 = " + set2 );

    HashSet set3 = set1.union( set2 );
    System.out.println( "set3 = set1.union( set2 ) = " + set3 );

    HashSet set4 = set1.intersection( set2 );
    System.out.println( "set4 = set1.intersection( set2 ) = " + set4 );

    HashSet set5 = set1.difference( set2 );
    System.out.println( "set5 = set1.difference( set2 ) = " + set5 );

    HashSet set6 = set1.symmetricDifference( set2 );
    System.out.println( "set6 = set1.symmetricDifference( set2 ) = " + set6 );

    System.out.println( "set4.subsetOf( set3 ) = " + set4.subsetOf( set3 ) );
    System.out.println( "set3.subsetOf( set4 ) = " + set3.subsetOf( set4 ) );