home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
HashSet6.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
730b
|
29 lines
import COM.objectspace.jgl.*;
/**
* Bounds. Duplicates allowed.
*
* @see COM.objectspace.jgl.HashSet
* @version 2.0.2
* @author ObjectSpace, Inc.
*/
public class HashSet6
{
public static void main( String[] args )
{
HashSet set = new HashSet( true ); // allow duplicates
set.add( new Integer( 3 ) );
set.add( new Integer( 8 ) );
set.add( new Integer( 2 ) );
set.add( new Integer( -2 ) );
set.add( new Integer( 3 ) );
set.add( new Integer( 10 ) );
System.out.println( set );
Range range = set.equalRange( new Integer( 3 ) );
while ( !range.begin.equals( range.end ) )
System.out.println( "match @ " + range.begin.nextElement() );
}
}