home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JSAMPLES.Z
/
HashSet6.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
775b
|
30 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import com.objectspace.jgl.*;
/**
* Bounds. Duplicates allowed.
*
* @see com.objectspace.jgl.HashSet
* @version 3.0.0
* @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() );
}
}