home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
Adapters1.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
802b
|
31 lines
// Copyright(c) 1996,1997 ObjectSpace, Inc.
import COM.objectspace.jgl.*;
/**
* Adapting built in Java arrays of Integers with algorithm usage.
*
* @see COM.objectspace.jgl.ArrayAdapter
* @version 2.0.2
* @author ObjectSpace, Inc.
*/
public class Adapters1
{
public static void main( String[] args )
{
int ints[] = { 3, -1, 2, -3, 4 };
IntArray intArray = new IntArray( ints );
System.out.println( "Unsorted native int array = " + intArray );
Sorting.sort( intArray );
System.out.println( "Sorted = " + intArray );
Shuffling.randomShuffle( intArray );
System.out.println( "Randomized = " + intArray );
for ( int i = 0; i < ints.length; i++ )
System.out.print( ints[ i ] + " " );
System.out.println();
}
}